cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
How to set random number generator to a
How to set random number generator to a range?
Mar 4, 2015 at 10:32pm UTC
samuel89m
(5)
Is there a way I could make the range between -100 and 100 for random number generator? thanks
Last edited on
Mar 5, 2015 at 6:14pm UTC
Mar 4, 2015 at 10:47pm UTC
keskiverto
(10402)
Yes. See
http://www.cplusplus.com/reference/cstdlib/rand/
However, there is a modern replacement for rand() in C++11. See
http://www.cplusplus.com/reference/random/
Topic archived. No new replies allowed.