This is a theoretical question: Assume I have 2 source files / compilation units, A.c and B.c
A.c:
int x;
B.c:
int x;
The variable x is considered to be shared between the objects. That is, one int was allocated somewhere and this variable is global and visible to all source files that declare it.
However I can also do this: B.c:
extern int x;
Is there any difference between extern and plain global variables in this context? And what is the difference in general?
Thanks!!