Re: enum variables and extern
- From: Chris Dollin <chris.dollin@xxxxxx>
- Date: Mon, 30 Apr 2007 16:18:06 +0100
Charlie wrote:
I have a file, data.c, where I define all of my global variables.
I then have a header file, data.h, which I include in every file in
which I reference all of the variables defined in data.c.
For the most part, I am having no problem with this. However, I
defined an variable of type myenum in data.c:
enum myenum
{
Mon,
Tues,
Wed
} enum_var;
Now when I try to reference enum_var in data.h, the compiler gives me
issues. I have tried multiple ways of referencing it and defining it,
but nothing is working. I guess I just don't understand something
about enum types and/or extern.
We did this last week (or was it the week before). Have a look in the
archives.
Briefly: you have to declare your enum type in your data.h file.
It worries me that you have so many global variables you have "all"
of them, and all in one place too.
--
"How am I to understand if you won't teach me?" - Trippa, /Falling/
Hewlett-Packard Limited registered no:
registered office: Cain Road, Bracknell, Berks RG12 1HN 690597 England
.
- References:
- enum variables and extern
- From: Charlie
- enum variables and extern
- Prev by Date: Re: enum variables and extern
- Next by Date: Re: enum variables and extern
- Previous by thread: Re: enum variables and extern
- Index(es):
Relevant Pages
|