getchar()的问题,搞到焦头烂额了————————————
#include <stdio.h>int main(void)
{
char ch;
char ch1;
ch=getchar();
printf("hello\n");
ch1=getchar();
printf("%c and %c",ch,ch1);
return 0;
}
运行时,输入:a回车后程序直接运行至末尾,也就是说:不会等待ch1的输入,这是为什么?
2013-02-18 10:21
2013-02-18 10:53
2013-02-18 11:29