#include <stdio.h>
main(){
int c;
c = getchar();
while (c!= EOF)
{
putchar(c);
c = getchar();
}
}
示例输出:
1. Output: Hi there ^Z?
Hi there ->_ (loop doesn't end)
2. Output: Hi there?
Hi there?
^Z (loop ends)
为什么在读取^ Z后第一种情况下的循环没有结束但是在第二种情况下结束?