---
name: "MPIR_Type_struct"
section: "3"
platform: "linux"
package: "mpich-doc"
version: "3.3-3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/MPIR_Type_struct"
---

# MPIR\_Type\_struct(3)

create a struct datatype

## NAME

MPIR\_Type\_struct -  create a struct datatype

## SYNOPSIS

```
#undef FUNCNAME
#define FUNCNAME MPIR_Type_struct
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
int MPIR_Type_struct(int count,
                     const int *blocklength_array,
                     const MPI_Aint * displacement_array,
                     const MPI_Datatype * oldtype_array, MPI_Datatype * newtype)
```

## INPUT PARAMETERS

- **count**

  \- number of blocks in vector

- **blocklength\_array**

  \- number of elements in each block

- **displacement\_array**

  \- offsets of blocks from start of type in bytes

- **oldtype\_array**

  \- types (using handle) of datatypes on which vector is based

## OUTPUT PARAMETERS

- **newtype**

  \- handle of new struct datatype

## RETURN VALUE

MPI\_SUCCESS on success, MPI errno on failure.
