Hi

Im having a problem with the following piece of code:

#include <iostream>
using namespace std;
#define something 33;

void main() {
    if (33 == something) {
        cout << "equals" << endl;
    }
}

Im using Visual C++ 2008 (not Express) and I get 2 errors and 1 warning when compiling:

line 6: error C2143: syntax error : missing ')' before ';'
line 6: error C2059: syntax error : ')'
line 6: warning C4390: ';' : empty controlled statement found; is this the intent?

I think this is really odd. Any Help?

never mind

i feel stupid

theres un unnecesary ; in de define line

Not forgetting the whole "void main" thing.
And the somewhat dubious rearrangement of the constants in the equality.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.