O'Reilly logo

C++11 for Programmers, Second Edition by Harvey M. Deitel, Abbey Deitel, Paul J. Deitel

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

20.4. Example: Card Shuffling and Dealing Simulation

The card shuffling and dealing program in Figs. 20.220.4 represents the deck of cards as an array of structures.

 1   // Fig. 20.2: DeckOfCards.h 2   // Definition of class DeckOfCards that 3   // represents a deck of playing cards. 4   #include <string> 5   #include <array> 6  7   // Card structure definition  8   struct Card                  9   {                           10      std::string face;        11      std::string suit;        12   }; // end structure Card    13 14   // DeckOfCards class definition15   class DeckOfCards16   {17   public:18      static const int numberOfCards = 52;19      static const int faces = 13;20      static const int suits ...

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