#include <stdio.h>
#if 0
int main(){
int (*ptr)[10];
int a[10]={99,1,2,3,4,5,6,7,8,9};
ptr=&a;
printf("%d",(*ptr)[1]);
}
#endif
//#if 0
int main()
{
int *ptr[10];
int a[10]={0,1,2,3,4,5,6,7,8,9};
printf("\n%p %p", ptr[0], a);
*ptr=a; //ptr[0] is assigned with address of array a.
printf("\n%p %p", ptr[0], a); //gives you same address
printf("\n%d",*ptr[0]); //Prints zero. If *ptr[1] is given then *(ptr + 1) i.e ptr[1] is considered which is uninitialized one.
return 0;
}
//#endif
/*
int (*ptr)[10];
is a pointer to an array of 10 ints.
int *ptr[10];
is an array of 10 pointers.
*/
To embed this program on your website, copy the following code and paste it into your website's HTML: