-3

Show me the difference between:

int* v[10];

and

int (*p)[10];

Please.

2 Answers2

5
int* v[10];

This declares v as an array of 10 pointers to int

int (*p)[10];

This declares p as the pointer to array of 10 ints

4pie0
  • 29,204
  • 9
  • 82
  • 118
1

With

int* v[10];

the variable v is an array of ten pointers to int.

The declaration

int (*p)[10];

declares p to be a pointer to an array of ten int.

Some programmer dude
  • 400,186
  • 35
  • 402
  • 621