where can i find these functions???????????????
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
> 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
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
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
Bri
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.
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement