Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

compile time error

Status
Not open for further replies.

RandallW

Programmer
Jun 24, 2000
18
0
0
US
I'm trying to convert a little C program into C++.&nbsp;&nbsp;One of<br>my enumerated types gives an error when the file is compiled;&nbsp;&nbsp;the 'flush' in it is being redefined ( according<br>to the compiler ); here it is....<br><br>enum win_result { loss = 0, jacks_or_better = 1, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;two_pair = 2, three_of_a_kind = 3,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;straight = 4, flush = 5, full_house = 8,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;four_of_kind = 25, straight_flush = 50,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;royal_flush = 250 };&nbsp;&nbsp;&nbsp;
 
Hi,<br><br>This is because the <br><br>ostream& flush(ostream&) <br><br>is defined in iostream.h.<br><br>Either do not include iostream.h or change the name of your enumeration.<br><br>It is always a good practice to add some prefix like my_flush to everything that you have defined, So that it never conflicts !<br><br>-Amol <p> <br><a href=mailto: > </a><br><a href= this site for debugging...This is a good one !
 
So the term 'flush' is a reserved word?&nbsp;&nbsp;Agh! Dirty rotten <br>C++ *grumble*
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top