我寻求format_spec功能。上下文描述如下。
有没有这样的编译时函数?
#include <stdio.h>
#define typeof(x) __typeof(x)
int main(){
int x; /* Plain old int variable. */
typeof(x) y=8; /* Same type as x. Plain old int variable. */
//printing
printf(format_spec(typeof(x)), y);
/*I don't want to use:
printf("%d", y);
I want generic way to get format specifier for any type.*/
}