#include <iostream> using namespace std; #define mc_string(x) (#x) #define mc_null(x) (std::cout<<mc_string(x)<<" has value"<<10;) int main() { mc_null("abc"); return 0; }
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:4:62: error: expected ‘)’ before ‘;’ token #define mc_null(x) (std::cout<<mc_string(x)<<" has value"<<10;) ^ prog.cpp:7:2: note: in expansion of macro ‘mc_null’ mc_null("abc"); ^~~~~~~ prog.cpp:4:63: error: expected primary-expression before ‘)’ token #define mc_null(x) (std::cout<<mc_string(x)<<" has value"<<10;) ^ prog.cpp:7:2: note: in expansion of macro ‘mc_null’ mc_null("abc"); ^~~~~~~
Standard output is empty