... generation capabilities that were introduced in Section 6.9.
Figure 7.8 uses the array
frequency
(line 17) to count the occurrences of die value. The single statement in line 21 of this program replaces the entire switch
statement in lines 22–43 of Fig. 6.7. Line 21 uses a random value to determine which frequency
element to
Get C++ How to Program, 10/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.