The following code gave error on gcc compiler
int main()
{
extern int a;
printf("%d",a);
return 0;
}
static int a=5;
But when static is removed from int a then it runs with no errors..Can someone please clear the doubt??
- See more at: http://forum.codecall.net/topic/74810-static-variables/#sthash.FpEOfC55.dpuf
int main()
{
extern int a;
printf("%d",a);
return 0;
}
static int a=5;
But when static is removed from int a then it runs with no errors..Can someone please clear the doubt??
- See more at: http://forum.codecall.net/topic/74810-static-variables/#sthash.FpEOfC55.dpuf