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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird #define problem

Status
Not open for further replies.

cpjust

Programmer
Sep 23, 2003
2,132
US
I'm not sure what the compiler is complaining about?
I'm getting a "error C2143: syntax error : missing ';' before '<<'" on the Cout line below:
Code:
#ifdef UNICODE
#  define Cout wcout;
#else
#  define Cout cout;
#endif	// UNICODE

...

Cout << "Blah blah blah." << endl;  // error C2143 here
but if I change that line to:
Code:
wcout << "Blah blah blah." << endl;
Then it compiles fine.
I have UNICODE defined, so what's different about the 2nd example vs. letting the preprocessor change Cout to wcout?
 
Nevermind. I just found it. #defines don't end with a semicolon. Doh! :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top