hello,
i am jeysree.i have a doubt.
please look at the following two snippets.it doesnt shows any error
the following two shows errors
please explain the use of static here.the error shown is illegal initialisation
i am jeysree.i have a doubt.
please look at the following two snippets.it doesnt shows any error
Code:
#include<stdio.h>
#include<conio.h>
void main()
{
static int a[10]={1,2,3,4,5};
static int *p[10]={a,a+1,a+2,a+3,a+4};
.
.
.
.
getch();
}
Code:
void main()
{
static int a[10]={1,2,3,4,5};
int *p[10]={a,a+1,a+2,a+3,a+4};
.
.
.
.
.
.
getch();
}
Code:
void main()
{
int a[10]={1,2,3,4,5};
int *p[10]={a,a+1,a+2,a+3,a+4};
.
.
.
.
.
getch();
}
Code:
void main()
{
int a[10]={1,2,3,4,5};
static int *p[10]={a,a+1,a+2,a+3,a+4};
.
.
.
.
.
getch();
}
Comment