#### Archived

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

# random numbers! ARGH!

## Recommended Posts

Quantum    122
argh!!!!!! why cant i get: srand((unsigned)time(NULL)); to work?? im writing a simple pong clone for win32 using gdi, and i NEED random numbers!! when i try to compile i get the errors: error C2501: ''srand'' : missing storage-class or type specifiers error C2373: ''srand'' : redefinition; different type modifiers see declaration of ''srand'' plz help

##### Share on other sites
Nazrix    307
Do you have this:

  #include

##### Share on other sites
Quantum    122
yes i do!!
are there any other #include's i need to do?

edit: and is there any particular order i should have my #define's in?

Edited by - Quantum on July 22, 2000 11:03:27 PM

##### Share on other sites
zerwit    122
That does not sound like any include problem. Are you sure that you haven''t missed a semi colon before that statement, or something like that. That is a very wierd error to get for that statement.

*** Triality ***

##### Share on other sites
Quantum    122
i fixed it!!

the srand() was at the top of the file, just below the #define''s. i simply moved it to the beginning of WinMain() and it worked fine! strange...

##### Share on other sites
Serge K    154
srand() is required <stdlib.h>
I guess, you have moved it below the correct include.

Edited by - Serge K on July 23, 2000 2:45:45 AM