Mail Archives: djgpp/1998/07/18/23:47:41
I think that cout should not be used when trying to print out something
colored. You should instead use cprintf.:
*****begin
#include <iostream.h>
#include <conio.h>
int main()
{
int i=0;
for(i=0; i<16; i++)
{
textcolor(i);
// commented out cout << "ABCDEFG\n";
cprintf("ABCDEFG\n\r");
}
}
*****end
Remember that cprintf behaves differently from printf in handling '\n',
so you have to add a '\r' to be sure to go to the next line ('\n':
newline) and to go to the start of the line ('\r': carriage return).
--
Flavio Poletti
e-mail: poletti AT writeme DOT com
web page: http://www.aspide.it/freeweb/poletti/
La libertà [americana] è lì, alla portata di tutti...
... come la chitarra ....
... ognuno suona come vuole ...
... e tutti suonano come vuole la libertà!
(G. Gaber)
- Raw text -