#include<stdio.h>
int x=13;
int x;
int main(){
printf("%d\n",x);
}
The code compiled above, but the one below does not work. why?
#include<stdio.h>
int main(){
int x=13;
int x;
printf("%d\n",x);
}
I was told that int x; can be interpreted by complier as a declaration or definition depending on the context. I see that in the first case (global), but what happens in the second.
source
share