fork download
  1. #include <stdio.h>
  2.  
  3. #define CAT_(x, ...) x ## __VA_ARGS__
  4. #define CAT(...) CAT(__VA_ARGS__)
  5.  
  6. #define CHECK_N(x, n, ...) n
  7. #define CHECK(...) CHECK_N(__VA_ARGS__, 0)
  8. #define PROBE(x) x, 1
  9.  
  10. #define IS_CHAR(t) CHECK(CAT_(IS_CHAR_, t))
  11. #define IS_CHAR_char PROBE(~),
  12.  
  13. #define QUOTE_(...) #__VA_ARGS__
  14. #define QUOTE(...) QUOTE_(__VA_ARGS__)
  15.  
  16. #define PRINT(...) puts(QUOTE(__VA_ARGS__))
  17.  
  18. int main(void)
  19. {
  20. PRINT(IS_CHAR(char), IS_CHAR(int), IS_CHAR(char**));
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
1, 0, 1