O'Reilly logo

Using the C++ Standard Template Libraries by Ivor Horton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 8

image

Generating Random Numbers

The need to generate random numbers arises very often. Most games programs, programs that simulate the real world, almost always need the ability to generate random numbers. Testing a complex program usually needs random input at some point to validate that the program works under diverse conditions, and it’s often convenient to generate such input programmatically. Of course, random numbers can be used to generate random choices of objects, so you have the ability to create random selections of anything.

Unless noted otherwise, all the STL templates discussed in this chapter are defined in the random header. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required