C doubt regarding array of pointers please explain
- by ramya
why do we use static with array of pointers?what is the relation betwwen static and array of pointers??plz help....
for eg:
main()
{
int a[]={1,2,3};
int *p[]={a,a+1,a+2};
......
}
this code shows illegal initialization.why?whereas the following code works
main()
{
static int a[]={1,2,3};
static int *p[]={a,a+1,a+2};
......
}
please do clear my doubt as soon as possible....