Hello everyone,
The compile error of the following code is,
foo.cpp(7) : error C2146: syntax error : missing ';' before identifier '_'
foo.cpp(7) : error C2065: '_' : undeclared identifier
foo.cpp(7) : error C2143: syntax error : missing ';' before 'string'
I do not know why there is errors. I think in MERGE macro, the value of parameter a is hello and the value of parameter b is world in my case, and I defined hello_world to "H E L L O", it should be fine...
Any ideas?
Code:
#define MERGE(a,b) a ## _ ## b
#define hello_world "H E L L O"
int foo()
{
char* p0;
p0 = MERGE("hello", "world");
return 0;
}
thanks in advance,
George