Click here to Skip to main content
16,011,428 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Use IE to render to bitmap or file? Pin
Todd Smith28-Jul-03 10:45
Todd Smith28-Jul-03 10:45 
GeneralXP Worker Thread File IO Issue Pin
chipg_al28-Jul-03 8:36
chipg_al28-Jul-03 8:36 
GeneralRe: XP Worker Thread File IO Issue Pin
AlexO28-Jul-03 10:27
AlexO28-Jul-03 10:27 
GeneralRe: XP Worker Thread File IO Issue Pin
chipg_al28-Jul-03 11:57
chipg_al28-Jul-03 11:57 
GeneralRe: XP Worker Thread File IO Issue Pin
valikac28-Jul-03 12:09
valikac28-Jul-03 12:09 
GeneralBig Multithread Problem Pin
Member 49993428-Jul-03 7:01
Member 49993428-Jul-03 7:01 
GeneralRe: Big Multithread Problem Pin
Member 49993428-Jul-03 7:04
Member 49993428-Jul-03 7:04 
Generalsrand() Pin
Sad Programmer28-Jul-03 6:42
sussSad Programmer28-Jul-03 6:42 
Hello,

I am new to .Net and more of an old school programmer. I for the life of me can’t make srand() work in .Net. this is the line of code that has always worked for me in the past:

srand(time(NULL));

The Error I get is:

error C2365: 'srand' : redefinition; previous definition was a 'function'

And

error C2501: 'srand' : missing storage-class or type specifiers

Now that damn intellisense or however you spell it tells me that srand() will return an int when I hover my mouse over the function call. So I thought that the computer knew what was going on so I tried to catch that int in a variable only to be told:

error C2440: 'initializing' : cannot convert from 'void' to 'int'

So after searching many web sites and books the only way I can find to seed the rand() is with srand(). Have I been left in the dark? Has the call to the system clock changed? What is going on with my lousy srand() call?

P.S. I did include time.h and I have not redefined srand() or rand() at all. I am new to namespace std so maybe I have messed something up in there.

Thanks.
GeneralRe: srand() Pin
Sad Programmer28-Jul-03 7:05
sussSad Programmer28-Jul-03 7:05 
GeneralRe: srand() Pin
Sad Programmer28-Jul-03 8:35
sussSad Programmer28-Jul-03 8:35 
GeneralRe: srand() Pin
Sad Programmer28-Jul-03 8:37
sussSad Programmer28-Jul-03 8:37 
GeneralRe: srand() Pin
Toni7828-Jul-03 9:55
Toni7828-Jul-03 9:55 
GeneralRe: srand() Pin
Sad Programmer28-Jul-03 10:10
sussSad Programmer28-Jul-03 10:10 
GeneralToolbar question Pin
Shay Harel28-Jul-03 6:01
Shay Harel28-Jul-03 6:01 
GeneralRe: Toolbar question Pin
Shay Harel28-Jul-03 6:36
Shay Harel28-Jul-03 6:36 
GeneralRe: Toolbar question Pin
Chris Richardson28-Jul-03 9:24
Chris Richardson28-Jul-03 9:24 
GeneralRe: Toolbar question Pin
Shay Harel28-Jul-03 9:28
Shay Harel28-Jul-03 9:28 
GeneralRe: Proper use of _bstr_t Pin
David Crow28-Jul-03 5:10
David Crow28-Jul-03 5:10 
GeneralRe: Proper use of _bstr_t Pin
nibor28-Jul-03 23:16
nibor28-Jul-03 23:16 
GeneralManaging right click in a CListBox control Pin
doctorpi28-Jul-03 4:25
doctorpi28-Jul-03 4:25 
GeneralRe: Managing right click in a CListBox control Pin
Beer2628-Jul-03 4:30
Beer2628-Jul-03 4:30 
GeneralRe: Managing right click in a CListBox control Pin
doctorpi28-Jul-03 4:33
doctorpi28-Jul-03 4:33 
Generalretrieving hardware information(win2k) Pin
Alexander M.,28-Jul-03 4:11
Alexander M.,28-Jul-03 4:11 
GeneralRe: retrieving hardware information(win2k) Pin
Mike Nordell28-Jul-03 13:46
Mike Nordell28-Jul-03 13:46 
GeneralRe: retrieving hardware information(win2k) Pin
Alexander M.,29-Jul-03 2:29
Alexander M.,29-Jul-03 2:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.