Linux下getch()和getche()
I would recommend never mixing input techniques in a program. Don't mix fgets() or scanf() with getchar(). Don't mix any standerd C library input function with a non-standard function that bypasses the C stream mechanism, be that getch(), getche(), bioskey(), or anything else. Note that these functions do not read from stdin, they read from a hardware keyboard, which is not the same thing.
Functions like getch() and getche() haven't been incorporated into the C standard because not all host systems provide ways to turn off input buffering. Thus compilers include these as common extensions wherever possible.
It is worth pointing out that writing Standart C (or Standart POSIX or whatever) is not always useful or desirable. It is up to the programmer to decide when and whether the benefits of sticking to any particular standards are worth their costs. But in order to make such a decision (and execute it), information *about* those standards is very important.
希望大家能够写出自己的getch() or getche()。
以上是在网站http://bytes.com上的摘录,链接为http://bytes.com/topic/c/answers/476130-getch-getche