fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. #define CONCAT_MACRO_(a,b) a ## b
  5.  
  6. #define COMLIN CONCAT_MACRO_(/,/)
  7.  
  8.  
  9. int main()
  10. {
  11. cout << "1\n";
  12. COMLIN << "Sakra!\n";
  13. cout << "2\n";
  14.  
  15. return 0;
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:6:30: error: pasting "/" and "/" does not give a valid preprocessing token
 #define COMLIN CONCAT_MACRO_(/,/)
                              ^
prog.cpp:4:28: note: in definition of macro ‘CONCAT_MACRO_’
 #define CONCAT_MACRO_(a,b) a ## b
                            ^
prog.cpp:12:2: note: in expansion of macro ‘COMLIN’
  COMLIN << "Sakra!\n";
  ^
prog.cpp: In function ‘int main()’:
prog.cpp:6:30: error: expected primary-expression before ‘/’ token
 #define COMLIN CONCAT_MACRO_(/,/)
                              ^
prog.cpp:4:28: note: in definition of macro ‘CONCAT_MACRO_’
 #define CONCAT_MACRO_(a,b) a ## b
                            ^
prog.cpp:12:2: note: in expansion of macro ‘COMLIN’
  COMLIN << "Sakra!\n";
  ^
prog.cpp:6:32: error: expected primary-expression before ‘/’ token
 #define COMLIN CONCAT_MACRO_(/,/)
                                ^
prog.cpp:4:33: note: in definition of macro ‘CONCAT_MACRO_’
 #define CONCAT_MACRO_(a,b) a ## b
                                 ^
prog.cpp:12:2: note: in expansion of macro ‘COMLIN’
  COMLIN << "Sakra!\n";
  ^
prog.cpp:12:9: error: expected primary-expression before ‘<<’ token
  COMLIN << "Sakra!\n";
         ^
stdout
Standard output is empty