Skip to main content
GameDev.net gamedev.net
🔒 Locked

quick really easy question

Started by hello_there Jan 16, 2003 at 8:07 PM 6 replies 100+ views
Original Post
hello_there
hello_there
what do you type to seed the random numbers generator in c++. also you only need to call it once at the start of your programe right?.
____________How could hell be worse?
Miserable
Miserable
srand() seeds the random number generator. You might want to seed it with the current time to get a ''random'' seed, i.e. srand(time(0)). To your second question: Yes.
hello_there
hello_there
do you have to include anything to make the work cause it says term does not evaluate to a function.
____________How could hell be worse?
fartocci
fartocci
#include <cstdlib> that should do it
Qa303asmGuru
Qa303asmGuru
quote:
Original post by Anonymous Poster
RTFM.

Enough said.


Hey maybe he doesn''t have a manual. Or maybe he does, but those damn help files are so confusing, it''s no wonder people ask their questions here.

Lighten up AP!!! Wait a minute...I posted that!

oops.

yes. i am an idiot.

-Q



This guy knows everything about the real world.
hello_there
hello_there
stop the lies i included that but it still says the same thing. doing this btw:
srand(time(0));
____________How could hell be worse?
hello_there
hello_there
opps i had a variable called time. i''m stupid.
____________How could hell be worse?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.