#include <stdio.h>
#define is_int_const_int(n) _Generic((&n), \
const int *: "const int", \
int *: "int", \
default: "other type")
int main(void)
{
const int ci = 99;
int i = 10;
float f = 3.14;
printf("ci is: %s\n", is_int_const_int(ci));
printf("i is: %s\n", is_int_const_int(i));
printf("f is: %s\n", is_int_const_int(f));
return 0;
}
/*
run:
ci is: const int
i is: int
f is: other type
*/