[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CppLrand
std::rand is like std::_lrand, except it returns random numbers is a smaller range. Check out the Boost C++ library for other random number generators.
The code below draws 10 different random numbers.
See std::rand for more details.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CppLrand
(C++) std::_lrand
Function for drawing a random positive integer from zero to LRAND_MAX. LRAND_MAX is a #defined constant in stdlib.h.std::rand is like std::_lrand, except it returns random numbers is a smaller range. Check out the Boost C++ library for other random number generators.
The code below draws 10 different random numbers.
int main () { for (int i=0; i!=10; ++i) { std::cout << std::_lrand() << std::endl; } }
- include <iostream>
See std::rand for more details.
'_lrand' links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
