C doesn't have any run-time type information. The best you can achieve with standard C is to manually list all supported types at compile-time, then at compile-time check which one that was used. Example:
#include <stdio.h>
#define TYPE_STR(x) _Generic((x),
int: "int",
double: "double",
char: "char" )
int main()
{
int x=10;
printf("%d %s",x,TYPE_STR(x));
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…