How to avoid pressing Enter with getchar() for reading a single character only?

后端 未结 12 1921
长发绾君心
长发绾君心 2020-11-22 00:33

In the next code:

#include 

int main(void) {   
  int c;   
  while ((c=getchar())!= EOF)      
    putchar(c); 
  return 0;
}
12条回答
提交回复
热议问题