C
Charlie
I tried to post this before and I apologize if I am repeating myself,
but I do not see the post anywhere.
But anyway,
I have a file, data.c, where I define all of my global variables. I
then use the extern keyword to reference those variables from a header
file, data.h, which I include in every file.
I am defining an enum type and variable in data.c:
enum myenum
{
val1,
val2,
val3,
} enum_var;
When I try to reference enum_var in data.h I always get an error. I
have tried numerous ways of referencing it and defining it but I
always seem to get a compiler error.
So how can I externally reference enum_var in data.h so that I can use
enum_var in my program? And if I am totally missing the point on
this, if someone could clear up my confusion about enum or extern that
would be great.
Thank you,
Charlie
but I do not see the post anywhere.
But anyway,
I have a file, data.c, where I define all of my global variables. I
then use the extern keyword to reference those variables from a header
file, data.h, which I include in every file.
I am defining an enum type and variable in data.c:
enum myenum
{
val1,
val2,
val3,
} enum_var;
When I try to reference enum_var in data.h I always get an error. I
have tried numerous ways of referencing it and defining it but I
always seem to get a compiler error.
So how can I externally reference enum_var in data.h so that I can use
enum_var in my program? And if I am totally missing the point on
this, if someone could clear up my confusion about enum or extern that
would be great.
Thank you,
Charlie