首先看下printf函数的声明
int printf ( const char * format, ... );
Print formatted data to stdout
Writes the C string pointed by format to the standard output (stdout). If format includes format specifiers (subsequences beginning with %), the additional arguments following format are formatted and inserted in the resulting string replacing their respective specifiers.
第一个参数format 是表示输出格式的 其中 %d 表示整形数输出 %c 表示 char类型的输出
后面的参数是和前面的带有%的格式一一对应的。
printf("%d %d %c\n",a,b,c);表示 a b以整形输出c以字符格式输出
&这个符号在定义变量的时候是表示引用,在传递参数和赋值的时候表示取这个变量的地址。
printf("%d %d %c\n",&a,&b,&c);表示 a b变量的地址以整形输出 c变量的地址以字符格式输出
这种输出肯定是不对的。地址一般是%p格式输出
温馨提示:答案为网友推荐,仅供参考