Fatboysam
Fatboysam

Reputation: 21

Typedef pointer to an array of another typedef

I will like to declare a typedef, something like this:

for e.g.:

Typedef 1:

typedef struct
{
    int a;
}structA_t1;

Typedef 2:

typedef ptrstructA  structA_t1 (*Temp)[]  ;

Is this second typedef correct ? Do i really need this Temp name here ? Please suggest, thanks

Upvotes: 2

Views: 1412

Answers (1)

Yochai Timmer
Yochai Timmer

Reputation: 49269

The name of the newly defined type comes in the end:

typedef structA_t1 **ptrstructA;

or:

typedef structA_t1 (*ptrstructA)[];

Upvotes: 7

Related Questions