Re: Split into several .c files -> where to put the global variables?

From: Ralf Fassel (
Date: 09/07/05

Date: Wed, 07 Sep 2005 11:34:02 +0200

* "Alexander Farber" <>
| Should I keep the variables in the main token-server.c and put the
| "extern" declarations into token-server.h?

That's the usual way this is done. You need the declaration in every
source file which uses the global variable, and the definition in
exactly one source file. You can play tricks with the preprocessor in
the header file, but in my experience it is cleaner if you maintain
the double list. If you get it wrong, the compiler will complain