.header(ing) them off at the pass

Peter da Silva peter at ficc.UUCP
Tue Jul 12 00:31:19 AEST 1988


In article <1076 at mit-caf.MIT.EDU>, vlcek at mit-caf.MIT.EDU (Jim Vlcek) writes:
> What I was saying was:  People are pointing out that putting
> initializations in the .header file eliminates one variable
> declaration/definition.

I have one question:

What does your compiler do when you say this?

	extern int foo;
	...
	int foo = 10;

Mine tells me I'm trying to initialise an extern and refuses to compile it.

This means, that I have two choices: either define that sucker in the
header using the technique I laid out, or don't include the .h file when
I define the variable. The latter alternative give me a place to screw up
that otherwise wouldn't exist (every other use of the variable is
accompanied by the include file).

What do you do about this?
-- 
-- `-_-' Peter (have you hugged your wolf today) da Silva.
--   U   Ferranti International Controls Corporation.
-- Phone: 713-274-5180. CI$: 70216,1076. ICBM: 29 37 N / 95 36 W.
-- UUCP: {uunet,academ!uhnix1,bellcore!tness1}!sugar!ficc!peter.



More information about the Comp.lang.c mailing list