|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
#include <conio.h> int getche(void);
A single character from the predefined standard input handle is read and
returned. The input is not buffered. If there is a character pending
ungetch (see section ungetch), it is returned instead. The
character is echoed to the screen. This function doesn't check for
special characters like Ctrl-C.
If the standard input handle is connected to the console, any pending
output in the
stderr streams is flushed before
reading the input, if these streams are connected to the console.
It's not safe to call this function inside static constructors, because conio needs to be initialized, and its initialization is done by a static constructor. Since you don't have any control on the order in which static constructors are called (it's entirely up to the linker), you could have problems.
If you can detect the situation when one of the conio functions is
called for the very first time since program start, you could work
around this problem by calling the
manually (this is the function called by a static constructor).
|webmaster donations bookstore||delorie software privacy|
|Copyright © 2004 by DJ Delorie||Updated Apr 2004|