global data in C programming... (another way)

Doug Gwyn gwyn at brl-smoke.ARPA
Sun Mar 20 13:41:17 AEST 1988


In article <1089 at bentley.UUCP> cox at bentley.UUCP (59463-MH Cox) writes:
>A better way (my opinion) would be to have one file, e.g. globals.c or in
>main.c, with all the initialized definitions.

Source code that has a large number of global data pooled like this
is woefully out of control.  The proper place for defining a global
datum (of which there should not be many!) is in the module that
controls its meaning.  If there isn't any such module, chances are
that the design is quite poor.



More information about the Comp.lang.c mailing list