Mail Archives: djgpp/1999/01/01/11:21:51
On 1 Jan 1999, Twidler444 wrote:
> Say I declare the variable ROOM in the main file and also use it in the second
> file. How do I take care of this? Do I include the second file? (#include
You can't do it that way - or at least it won't be easy.
Easiest way is to make external "variables" -c file, where
you declare _all_ variables, and include it to every other file.
Practically it would be something like this;
vars.c:
#include <vars.h>
<define variables here, example; char room [30];>
vars.h:
<define external variables; extern char room [30];>
room62.c: (one of your part files)
#include <vars.h>
<other includes and everything...>
main.c: (main routine)
#include <vars.h> ...
/// Toni Räsänen
/// torasane AT mail DOT student DOT oulu DOT fi
\\\ Physicians ask how. Filosofians ask why. Dragons don't care.
- Raw text -