-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
  • 28,488
  • 8
  • 76
  • 116
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
  • 380,411
  • 33
  • 383
  • 585