How would I create a random number?

Posted by Elliot Bonneville on Stack Overflow See other posts from Stack Overflow or by Elliot Bonneville
Published on 2010-05-14T22:33:29Z Indexed on 2010/05/14 23:04 UTC
Read the original article Hit count: 367

How would I create a random number using C++? I've heard that one should use the time as a seed, but I'm not sure how to do that with the correct syntax. How would I do this?

One more thing - how would I limit the random number to a particular range? I'm simulating a dice roll and getting numbers in the millions...

© Stack Overflow or respective owner

Related posts about random-number-generator

Related posts about c++