difference between (*m) [5] and *m [5] code example

Example: difference between (*m) [5] and *m [5]

/*
int *a[5] - It means that "a" is an array of pointers i.e. each member in the array "a" is a pointer
of type integer; Each member of the array can hold the address of an integer.

int (*a)[5] - Here "a" is a pointer to the array of 5 integers, in other words "a" points to an array that holds 5 integers.
*/

int a[5] = {0, 1, 2, 3, 4};
int (*p)[5]; // pointer to array of 5 ints
int* b[5];   // array of 5 pointers to int

p = &a; // p points to a

Tags:

Misc Example