Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

killer333

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

This topic is 6383 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!