--- sunit sinha <[EMAIL PROTECTED]> wrote:

> declare enums in file_1.h as 
> 
> enum (
> aa_req,
> aa_resp
> }aa;
> and in file_2.h as
> 
> enum {
> bb_req,
> bb_resp,
> aa_req,
> aa_resp
> }bb;
> 
 
What would that accomplish? 

Ray

> ----- Original Message ----
> From: Ravi Mishra <[EMAIL PROTECTED]>
> To: [email protected]
> Sent: Sunday, 3 June, 2007 11:27:28 PM
> Subject: [c-prog] Problem in inclusion of Header
> files.
> 
>             Hi All,
> 
> 
> 
> I am facing compilation problem..The problem is like
> that, Let's we
> 
> have four files:
> 
> 
> 
> 1) file_1.h
> 
> 2) file_1.c
> 
> 3) file_2.h
> 
> 4) file_2.c
> 
> 
> 
> I have defined one enum in file_1.h like that:
> 
> 
> 
> enum (
> 
> aa_req,
> 
> aa_resp
> 
> };
> 
> 
> 
> and another enum in file_2.h
> 
> 
> 
> enum {
> 
> bb_req,
> 
> bb_resp,
> 
> aa_req,
> 
> aa_resp
> 
> };
> 
> 
> 
> Now there is another file let's assume Test.c which
> include file_2.h
> 
> and file_1.h in that order
> 
> 
> 
> Test.c------ ---------
> 
> 
> 
> #include<file_ 2.h>
> 
> #include<file_ 1.h>
> 
> 
> 
> Now my problem is that when I am compiling Test.c
> then I am getting
> 
> conflict ion....Can any body suggest me....
> 
> 
> 
> if file_2.c creates it's object file which already
> contains
> 
> aa_req value 2 and
> 
> aa_resp value 3
> 
> 
> 
> then it would be possible that if file_1.c creates
> it's object file
> 
> then it would over write the value of aa_req and
> aa_resp.
> 
> 
> 
> Or any other method is there....suggest me.
> 
> I am also thinking to use of header guard but this
> would not be more effective.
> 
> TIA
> 
> -Ravi
> 



       
____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play 
Sims Stories at Yahoo! Games.
http://sims.yahoo.com/  

Reply via email to