How do I declare a pointer to a character array in C?
You can declare it as extern char (*p)[];
, but it's an incomplete type. This is of course because C has no "array" type generically that is a complete type; only arrays of a specific size are complete types.
The following works:
extern char (*p)[];
char arr[20];
char (*p)[20] = &arr; // complete type now: p points to an array of 20 chars