The problem is neither ANSI nor VS.
You must differentiate between definitions and code (.c files), and declarations (in .h files).
Handle global variables just like handling global functions. Declare them in a header file and define them in the corresponding source file:
extern int a;
#include "a.h"
int a = 10;
If you now want to use the global variable
a
from within another module, include the header file:
#include "a.h"
printf("a = %d\n", a);
If you put something like 'int a = 10;' into a header file, each file that includes this header file will have its's own copy of the variable. Then it is not global, but local to each module.