阅读背景:

如何清除C中的输入缓冲区?

来源:互联网 

I have the following program:

我有以下计划:

int main(int argc, char *argv[])
{
  char ch1, ch2;
  printf("Input the first character:"); // Line 1
  scanf("%c", &ch1); 
  printf("Input the second character:"); // Line 2
  ch2 = getchar();

  printf("ch1=%c, ASCII code = %d\n", ch1, ch1);
  printf("ch2=%c, ASCII code = %d\n", ch2, ch2);

  system("PAUSE");  
  return 0;
}
int m



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: