putchar(c) 外循环的值是多少?
main()
{
int c;
while (c = getchar() != EOF) {
printf("printf c_inloop :%d\n",c);
printf("Putchar c_inside: ");
putchar(c);
printf("\n\n");
}
putchar(c);
printf("printf c_outloop %d",c); /*outside loop*/
}
当我运行程序时,说“th”(wtq)并在cmd(Windows)中按回车:
th
printf c_inloop :1
Putchar c_inside:(gives me a smileyface emoticon)
printf c_inloop :1
Putchar c_inside:(gives me a smileyface emoticon)
printf c_inloop :1
Putchar c_inside:(gives me a smileyface emoticon)
^Z (Ctrl + Z)
printf c_outloop 0
注意前面的空格printf c_outloop 0
。是putchar(c)
空间的价值吗?