Skip to Content
C++ How to Program, 10/e
book

C++ How to Program, 10/e

by Paul Deitel, Harvey Deitel
February 2016
Beginner
1080 pages
207h 57m
English
Pearson
Content preview from C++ How to Program, 10/e
... simulates
 3  // the shuffling and dealing of a deck of playing cards.
 4  #include <iostream>
 5  #include <iomanip>
 6  #include <cstdlib> // prototypes for rand and srand
 7  #include <ctime> // prototype for time
 8  #include "DeckOfCards.h" // DeckOfCards class definition
 9  using namespace std;
10
11  // no-argument DeckOfCards constructor intializes deck
12  DeckOfCards::DeckOfCards() {
13     // initialize suit array
14     static string suit[suits]{"Hearts", "Diamonds", "Clubs", "Spades"};
15
16     // initialize face array
17     static string face[faces]{"Ace", "Deuce", "Three", "Four", "Five",
18        "Six", "Seven", "Eight", "Nine", "Ten", "Jack", "Queen", "King"};
19
20     // set values for deck of 52 Cards
21     for (size_t i{0}; i < deck.size(); ++i) {
22        deck[i].face = face[i ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C++ How to Program, Sixth Edition

C++ How to Program, Sixth Edition

P. J. Deitel - Deitel & Associates, Inc., H. M. Deitel - Deitel & Associates, Inc.
C++ How to Program, Ninth Edition

C++ How to Program, Ninth Edition

Paul Deitel, Harvey Deitel

Publisher Resources

ISBN: 9780134448930Purchase book