|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
#include <conio.h> void textattr(int _attr);
Sets the attribute used for future writes to the screen:
---- XXXX = foreground color -XXX ---- = background color X--- ---- = 1=blink 0=steady
The include file <conio.h> contains an enum COLORS that define the various values that can be used for these bitfields; light colors can only be used for the foreground.
/* blinking white on blue */ textattr(BLINK | (BLUE << 4) | WHITE);
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||delorie software privacy|
|Copyright © 2004||Updated Apr 2004|