Reputation: 413
int *a[5];
Is this an array of 5 pointers or a pointer pointing to an array of size 5?
Upvotes: 1
Views: 723
Reputation: 3691
that's an array of pointers. that's because int *
is a type, unlike the impression most people get that the type is int
and the name is *a
.
Upvotes: 0
Reputation: 59617
It's an array of 5 pointers to int
.
You might find the right-left rule helpful.
Upvotes: 3