fork download
  1. #include <iostream>
  2. using namespace std;
  3. #define mc_string(x) (#x)
  4. #define mc_null(x) (std::cout<<mc_string(x)<<" has value"<<10;)
  5.  
  6. int main() {
  7. mc_null("abc");
  8. return 0;
  9. }
Compilation error #stdin compilation error #stdout 0s 15232KB
stdin
Standard input is empty
compilation info
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");
  ^~~~~~~
stdout
Standard output is empty