I have this really weird doubt in extern usage
Consider the code
#include<stdio.h>
int main(void)
{
extern int a;
printf("%d",a);
getch();
return 0;
}
int a=20;
How is it that this code gives the output as 20 ???
My guess
Since its an extern variable, it can be declared anwhere( even outside the main).
Since its the same file, we dont have to do a #include"samefile.h"
Please correct me...