-1

The first declaration is commonly referred to as an array of pointers. Does the second declaration have a name or description that distinguishes it from the first declaration?

Declaration 1: int *p[SIZE]

Declaration 2: int (*p)[SIZE]

2 Answers2

2
 int *p[SIZE]

This is to declare array of SIZE number of pointers to int

Whereas , this -

int (*p)[SIZE]

declare p as pointer to array of int (having SIZE number of elements)

ameyCU
  • 16,489
  • 2
  • 26
  • 41
1

p is array of int pointers.

int *p[SIZE]

p is pointer to an array of integers

 int (*p)[SIZE]

Edit

The second kind of declaration is mentioned in 5.12 Complicated Declarations The C programming Language book. Here is some reference which explains complicated declarations

Gangadhar
  • 10,248
  • 3
  • 31
  • 50