RE: [Dev-C++] Global variables (linking errors)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ho...> - 2002-04-20 17:57:55
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Daniel Glenfield > Sent: Thursday, April 18, 2002 7:13 PM > To: dev...@li... > Subject: [Dev-C++] Global variables (linking errors) > > > Help me out here would you? I have three C++ source files, > each with its own > header file. I want to have a global variable that all three > source files > can use. You must place the global variable in your main source file only. At the other files use the keyword extern. E.g. extern int x; Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.cjb.net * Alternative URL: http://run.to/noicys |