Next: , Previous: , Up: Pointers   [Contents][Index]


14.4 Pointer-Type Designators

Every type in C has a designator; you make it by deleting the variable name and the semicolon from a declaration (see Type Designators). Here are the designators for the pointer types of the example declarations in the previous section:

int *           /* Pointer to int. */
double *        /* Pointer to double. */
double (*)[5]   /* Pointer to double[5]. */

Remember, to understand what type a designator stands for, imagine the corresponding variable declaration with a variable name in it, and figure out what type that variable would have. Thus, the type designator double (*)[5] corresponds to the variable declaration double (*variable)[5]. That deciares a pointer variable which, when dereferenced, gives an array of 5 doubles. So the type designator means, “pointer to an array of 5 doubles.”