where can i find these functions???????????????

Started by
13 comments, last by killer333 23 years, 2 months ago
i need help(big surprise) what is the name of the header file that has the function that comes up with a random number? and one more thing i there a header that has a function that changes the color of the words the file i got dont work thanx
Advertisement
> what is the name of the header file that has the function that comes up with a random number?

srand() and rand() are in stdlib.h

> i there a header that has a function that changes the color of the words

Which words?

Bri

thanx man

the fundtion that changes the color of the font
In Windows? Maybe you''re looking for SetTextColor(HDC hdc, COLORREF crColor);

Bri
YES thats it
if i can use it for console yes thats it
where can i get it?

thanx
SetTextColor is a Windows function - not for the console. I don''t understand what you''re wanting exactly, and I don''t know of any text-color functions off-hand for the console - you could look through the manuals just as easily as me.

Bri
what is srand() for????
i cant figure out wat its for
srand seeds the random number generator, give it the current time or something (only do it ONCE - in main for example).

if you seed the generator with a constant, you will get identical ''random'' numbers generated each run (i think).


eg:
srand(GetTickCount());

int rndNum = rand() % 10; //generate a number in range 0<=x<10

the old borland text color stuff was in conio.h, but if you''re using MSVC, its not there.
Maybe this function interests you too: timeGetTime()
You want to write a win console progi right?

If you want to know which header you need for which function then you should search for the "function-name" in the MSDN Library.
Here is a link to the online version.

Edited by - Jonus on January 30, 2001 6:53:23 PM
thanks yorvik!!!!!!!
i really needed that bit of info
now i can continue with my demo text only RPG

This topic is closed to new replies.

Advertisement