extern int eg_i = 0;
int main(){
++eg_i; // 1
return 0;
}
This code surprisingly throws no compile error.
Because if an extern variable is declared with initialization, it is taken as the definition of the variable as well.
I didn't know there's an exception for the extern keyword.