void print_array(int(*p)[10], int len)
{
for (int i = 0; i < len; i++)
{
printf("%d ", (*p)[i]);
}
}
int main()
{
int arr[10] = { 0 };
int len = sizeof(arr) / sizeof(int);
for (int i = 0; i < len; i++)
{
arr[i] = i;
}
int(*p)[10] = arr;
print_array(p,len);
return 0;
}
Why the code of print_array's function can print the information of array?
I didn't realized the code,(*p)[i],so i want the master of programmer can help me to work out this qustion.
I guess that the reason that i didn't understand this code is that i don't realize the knowledge of the pointer of array.