fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. string hello("hello");
  6. string hi("hello");
  7.  
  8. void my_function(string r1, string r2) {
  9. cout << r1 << ',' << r2 << '\n';
  10. }
  11.  
  12. #define BEGIN_MATCHING ((void)0
  13. #define MATCH ); my_function(
  14. #define WITH ,
  15. #define END_MATCHING );
  16.  
  17. int main() {
  18. BEGIN_MATCHING
  19. MATCH hello WITH hi
  20. MATCH hello WITH hi
  21. END_MATCHING
  22. }
Success #stdin #stdout 0s 3460KB
stdin
Standard input is empty
stdout
hello,hello
hello,hello