Possible Duplicate:
Generate Random numbers uniformly over entire range
I want to generate the random number in c++ with in some range let say i want to have number between 25 and 63.
How can i have that.
Thanks
Possible Duplicate:
Generate Random numbers uniformly over entire range
I want to generate the random number in c++ with in some range let say i want to have number between 25 and 63.
How can i have that.
Thanks
You can use the random functionality included within the additions to the standard library (TR1). Or you can use the same old technique that works in plain C:
Use the
rand
function:http://www.cplusplus.com/reference/clibrary/cstdlib/rand/
Quote:
Since nobody posted the modern C++ approach yet,