[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c

Turbo C 2.0

Dave \Crash\ Dummy

5/3/2011 7:28:00 PM

Hi,

I tried a simple thing with my old Turbo C 2.0 on Windows XP:

#include <stdio.h>
#include <conio.h>

int main(void)
{
char Buffer[2];
clrscr();
textcolor(RED);
puts("RED");
fgets(Buffer, sizeof(Buffer), stdin);
}

But "RED" is written lightgray on black.
textcolor() is not working.
What am I missing?

kind regards
Heiner
1 Answer

Dave \Crash\ Dummy

5/3/2011 8:30:00 PM

0


"Heinrich Wolf" <invalid@invalid.invalid> schrieb im Newsbeitrag
news:ippl0u$dkp$1@news.m-online.net...
> #include <stdio.h>
> #include <conio.h>
>
> int main(void)
> {
> char Buffer[2];
> clrscr();
> textcolor(RED);
> puts("RED");
> fgets(Buffer, sizeof(Buffer), stdin);
> }
>
> But "RED" is written lightgray on black. textcolor() is not working.

I found out
puts("RED");
must be replaced by
cprintf("RED");
putchar('\n');