Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!brl-tgr!tgr!GEACC022%TIMEVX%CITHEX@lbl.arpa
From: GEACC022%TIMEVX%CITHEX@lbl.arpa
Newsgroups: net.lang.c
Subject: global declarations
Message-ID: <7197@brl-tgr.ARPA>
Date: Thu, 10-Jan-85 18:54:04 EST
Article-I.D.: brl-tgr.7197
Posted: Thu Jan 10 18:54:04 1985
Date-Received: Sat, 12-Jan-85 07:40:25 EST
Sender: news@brl-tgr.ARPA
Organization: Ballistic Research Lab
Lines: 23

Received: from timevx by cithex with DECNET ; Thu, 10 Jan 85 15:53:05 PST
Date:     Thu, 10 Jan 85 15:53:43 PST
From:     geacc022 (ansok, gary e.) @ timevx
Message-Id: <850110155338.00b@timevx>
Subject:  global declarations
To:       info-c @ brl-tgr.arpa
 
I had always thought that the "right way" to declare global variables
was:
 
1)  "extern" declaration in the .h file
2)  definition (and initialization) in one .c file
 
Remember, it is legal to have both an "extern" declaration and a
definition in the same file (or at least it should be -- K&R, p. 77).
I haven't seen the standard, so I don't know what it says about this.
 
			Gary Ansok
			GEACC022%TIMEVX%CITHEX @ LBL-G.ARPA
			GEA @ CALTECH.BITNET
			...{ucbvax,ihnp4}!cithep!timevx#geacc022
 
"All the world loves a straight man."