若有以下声明: char *p="%d,%d\n"; int a=l,b=2; 则执行语句"printf(p,a,b);"时输出_____
printf函数原型如下:
extern int printf(const char *format,...);
第一个参数是一个const char*类型,p是一个char* 常量,所以就相当于把p的内容直接放在里面:
printf("%d,%d\n",a,b);
输出结果就是1,2
printf(p,a,b)等价于printf("%d,%d\n",a,b),所以输出是:1,2。