2

I'm new to programming world and i'm studying about pointers and array. and i read this code on a website. what does this line of mean?

 int(*ptr)[10];

Is it a pointer or an array of size 10?

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
Umer Arif
  • 255
  • 1
  • 11

2 Answers2

2

It is a pointer to an array of 10 int.

Instead int *ptr[10] is an array of 10 int pointers.

dariofac
  • 247
  • 1
  • 14
0

https://stackoverflow.com/a/89100/5596981

Therefore it's a pointer to an array.

For another example, in int main(int argc, char* argv[]), argv is an array of pointers.

W2a
  • 736
  • 2
  • 9
  • 23