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
I looked around in some files like errno.h and could find the "extern" keyword plus other crazy stuff like _RTLENTRY, _EXPFUNC and _UNDERSCOREZZ.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 some and it seemed to me that extern does what I want, but it didn't work. I would getCompiler: bcc32 5.6.1Code:Error: Unresolved external '_integer' referenced from sth.obj



LinkBack URL
About LinkBacks



Mainly because I'm usually pedantic, and bored.