我有下面这个程序:
#include <stdio.h>
int main()
{
int ch;
while( ch = getchar() != '\n') {
printf("Read %c\n",ch);
}
return 0;
}
无论我输入什么,都会得到以下结果:
Read
为什么会发生这种情况,那个奇怪的字符是什么?
在Stackoverflow上没有打印出奇怪的字符。你可以在这里看到它:http://ideone.com/EfZHr