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