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?
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?
It is a pointer to an array of 10 int
.
Instead int *ptr[10]
is an array of 10 int
pointers.
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.