2

What is the difference between the following statements?

char *a[10];

char (*a)[10];
Lundin
  • 174,148
  • 38
  • 234
  • 367

2 Answers2

6

The former is an array of 10 char pointers. The latter is a pointer to an array of 10 char's.

Magisch
  • 7,198
  • 9
  • 38
  • 51
machine_1
  • 3,904
  • 2
  • 17
  • 39
1
char *a[10];

This declares array of 10 pointers to char .

Whereas , this -

char (*a)[10];

declares pointer to array of 10 char's

ameyCU
  • 16,146
  • 2
  • 24
  • 40