Archived

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

uncreativ

Visual C++ Randomize()

Recommended Posts

hello, i''m trying to make a black jack game for my data structurs class, and for some reason Visual C++ 6.0 can''t find the randomize() function. what header file is it in? i thought it was stdlib.h, but i''m still gettin the same error. if anyone has experienced the same problem, and knows how to get around it please let me know. thanks. -uncreativ president halosoft, inc. halosoft.hypermart.net

Share this post


Link to post
Share on other sites
To be more specific:

At the beginning of your program, put
srand(time(NULL));
to send a random seed to the random number generator. You only have to do this once your entire program.
Then when you need a random number,
int randomNumber = rand();

-fel

Share this post


Link to post
Share on other sites