我想知道具体printf("%d",x)是如何解释的。我只知道编译器保留一个内存来放置'%', '%d','\0'并将其地址返回到,然后根据我们指定的格式说明符printf打印第二个参数。x
printf("%d",x)
'%'
'%d'
'\0'
printf
x
那么,如果我使用 example int x=5; char *p="%d"; printf(p,x),它与 是一样的吗printf("%d",x)?
int x=5; char *p="%d"; printf(p,x)
c c++ printf
c ×1
c++ ×1
printf ×1