fork download
  1. #include <stdio.h>
  2.  
  3. #define CAT_(a, b) a##b
  4. #define CAT(a, b) CAT_(a, b)
  5.  
  6. #define PITUH_1_COCK 11
  7. #define PITUH_2_COCK 22
  8. #define PITUH_1_NE_COCK 1
  9. #define PITUH_2_NE_COCK 2
  10.  
  11. #define GET_PITUH(i, kind) CAT(PITUH_, CAT(i, CAT(_, kind)))
  12.  
  13. #define QUOTE_(...) #__VA_ARGS__
  14. #define QUOTE(...) QUOTE_(__VA_ARGS__)
  15.  
  16. #define TEST(...) puts(QUOTE(__VA_ARGS__))
  17.  
  18. int main(void)
  19. {
  20. TEST(GET_PITUH(1, COCK));
  21. TEST(GET_PITUH(2, COCK));
  22. TEST(GET_PITUH(1, NE_COCK));
  23. TEST(GET_PITUH(2, NE_COCK));
  24. }
Success #stdin #stdout 0s 4576KB
stdin
Standard input is empty
stdout
11
22
1
2