I have tried this example of array of pointers. I am getting the error "Illegal initialisation in function main"
int main()
{
int a[]={1,2,3,4,5};
int b[]={1,2,3,4,5};
int c[]={1,2,3,4,5};
int *p[3]={a,b,c};
int i;
clrscr();
for(i=0;i<3;i++)
printf("%d - %u\n",*p[i],p[i]);
getch();
}
If I use static int instead of int in array declarations, it works fine. Can any one tell me the effect of static here. Thanks a lot.