Path: utzoo!mnetor!uunet!husc6!mailrus!ames!oliveb!pyramid!uccba!hal!ncoast!btb From: btb@ncoast.UUCP (Brad Banko) Newsgroups: comp.lang.c Subject: global data in C programming... Message-ID: <7506@ncoast.UUCP> Date: 14 Mar 88 01:47:42 GMT Distribution: comp Organization: Cleveland Public Access UN*X, Cleveland, OH Lines: 40 Keywords: global data, extern, C programming how does one use global data in C programming? i thought that you just create a header file containing the global data declarations and then #include it into each of your source files, but when i try this (using Mark Williams C on an Atari ST), I get a "symbol redefined" message from the linker. basically, the type of thing that I am trying to do is: x.h: int i,j; x.c: #include "x.h" xyz() { i = ... } y.c: #include "x.h" zzt() { i = j ... } K&R doesn't help me out... the stuff about externs and header files is sort of minimal. Thanks. -- Brad Banko Columbus, Ohio (formerly ...!decvax!cwruecmp!ncoast!btb) btb%ncoast@mandrill.cwru.edu "The only thing we have to fear on this planet is man." -- Carl Jung, 1875-1961