File a.c
Code:int a = 5;
file b.c
My understanding was that if a file is within a project (a.c) and a variable was declared outside the scope of any of the functions within that file that that variable would be global....Am I incorrect here?Code:#include <stdio.h>int main() { printf("%d", a); return 0; }
Certainly when I place
before main the code compilesCode:extern int a;
Is there no such thing as a global variable that crosses file boundaries?
Thanks