I want to be able to declare a global variable in a header/source file and then use it in some other source file which has #included it, like
Code:
sth1.c
-----------
int integer;
sth2.c
----------
#include <stdio.h>
#include <sth1.c>
char* main ()
{
ineger = 45;
printf("%d", integer);
return "o-|-<";
}
I looked around in some files like errno.h and could find the "extern" keyword plus other crazy stuff like _RTLENTRY, _EXPFUNC and _UNDERSCOREZZ.
I looked around some and it seemed to me that extern does what I want, but it didn't work. I would get
Code:
Error: Unresolved external '_integer' referenced from sth.obj
Compiler: bcc32 5.6.1