From: "John M. Aldrich" Newsgroups: comp.os.msdos.djgpp Subject: Re: Help with text* ? Date: Wed, 22 Apr 1998 18:39:40 -0400 Organization: Two pounds of chaos and a pinch of salt. Lines: 31 Message-ID: <353E71AC.364@cs.com> References: <6hkk9f$b7p$1 AT news DOT metronet DOT de> NNTP-Posting-Host: ppp215.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Lennart Marien wrote: > > Hi! > Maybe this is a general question which is answered yet, > but why doesn´t textcolor or textbackground work in > DJGPP.I´m using the C compiler.It neither works > in graphic mode nor in textmode.I know the BIOS > Function to set Textattributes, should I use them instead? Let me guess - you're using textcolor(), etc. with printf()? This is wrong, because printf() goes through the DOS file handling functions and never sees your color settings. You should use conio.h functions for output when you change the text attributes. > And another simple > question how can I > set the RAND_MAX value, described in the help? You can't set it; it's a constant. To clip the value from rand() or random(), use the modulus operator: /* get value from 0 to 99 */ x = random() % 100; -- --------------------------------------------------------------------- | John M. Aldrich |"Men rarely (if ever) manage to dream | | aka Fighteer I |up a god superior to themselves. Most | | mailto:fighteer AT cs DOT com |gods have the manners and morals of a | | http://www.cs.com/fighteer |spoiled child." - Lazarus Long | ---------------------------------------------------------------------