Yeah Donbock what you said was certainly correct in it's own context but I guess I was not clear enough in my question.
Basically what I am asking is, why this peice of code dosen't work and what is the possible solution.
#ifdef ABC
#define TEST /
cout<<"abc"
#else
#define TEST
cout<<"xyz"
#endif
int main()
{
TEST;...
User Profile
Collapse
-
conditional expansion of a macro
Hi,
Can I use some conditional operator to select a part of code to be expanded.
What I meant was... Can I do something like this..
#define func(arg1) \
if arg1 == abc\ \* this line should not expand but just test*\
some code\
else\ \* this line should not expand but just test*\
some other code
Thanks
No activity results to display
Show More
Leave a comment: