I have a program:
#include <iostream>
#define _DEBUG = 1
using namespace std;
int main() {
#if (_DEBUG == 1)
cout << "hello : " <<endl;
#endif
return 0;
}
Compiling this gives the error:
$ g++ a.cpp
a.cpp:7:7: error: token "=" is not valid in preprocessor expressions
$ g++ --version
g++ (MacPorts gcc46 4.6.3_8) 4.6.3
I thought ==
is the equality conditional operator?
Just a typo, I think:
#define _DEBUG = 1
should be
#define _DEBUG 1
I do that all the time!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With