| www.delorie.com/archives/browse.cgi | search |
| From: | Endlisnis <s257m AT unb DOT ca> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: RHIDE Project |
| Date: | Mon, 14 Sep 1998 18:19:58 -0300 |
| Organization: | NBTel Internet |
| Lines: | 23 |
| Message-ID: | <35FD887E.199004BE@unb.ca> |
| References: | <6thggs$bp3$1 AT equila DOT wfpa DOT acad DOT bg> |
| NNTP-Posting-Host: | fctnts13c75.nbnet.nb.ca |
| Mime-Version: | 1.0 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
BDozer wrote:
> Is it possible the different modules to use common variables.
> I tried to put the global variables into header file and #include "it" from
> each module but that didn't work. What's the trick with these projects?
If you want a global like this:
int GlobalCount;
You can only declare that ONCE no matter how many 'modules' you use in a
project. In all of the other modules that need to use that variable you need
to put:
extern int GlobalCount;
You should put that in the 'h' file, and in ONE of the modules put the 'int'
line.
--
(\/) Endlisnis (\/)
s257m AT unb DOT ca
Endlisnis AT GeoCities DOT com
Endlis AT nbnet DOT nb DOT ca
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |