Bordenkircher
Saturday, 7 September 2013
generating random numbers in c++
generating random numbers in c++
I need to generate a random number between 1 and n where n is unsigned
int. If n were int I would simply write 1 + rand()% n. But unfortuantelly
n is unsigned int. What will you suggest?
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment