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?
I 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.
P.S. Someone suggested ::srand(time(NULL)); but that yields the same errors.