fork download
  1. #include <stdio.h>
  2. #define type(x) _Generic((x), \
  3.   int: "int", unsigned int: "unsigned int", \
  4.   float: "float", double: "double", \
  5.   long double: "long double", char *: "char *", \
  6.   void *: "void *", int *: "int *", \
  7.   default: "unknown")
  8. var;
  9. int main() {
  10. printf("%s\n", type(var));
  11. return 0;
  12. }
Success #stdin #stdout 0.01s 5392KB
stdin
Standard input is empty
stdout
int