I'd like to print the type that typeof() outputs, but typeid is only available in C++. Why can't I use stringification to get the name of this type?
#define GET_STRING(s) #s#define example(input) \ do { \ char test[20] = GET_STRING(typeof(input)); \ printf(test); \ } \ while (0) \
This would print out "typeof()" with input stringified inside. Why does the preproccessor stringify before typeof() is handled? Is there a way to override this behavior?
You can stringify types directly if they are passed like GET_STRING(int), so using typeof() should have the same behavior.