I am gonna to write an ADT that represents the pile of cards used in a solitaire game. At first, i create a header file with class Pile.
Code:// Pile.h #ifndef PILE_H #define PILE_H class Pile { public: void addCard(const Card&card); //Adds a card to the Pile void dump() const; private: list<Card> cards; // Adds a card to the Pile }; #endif
My question is, inside the private, can i use
to feed this requitement -> The Pile must have one attribute - a STL List of Cards.Code:list<Card> cards; // Adds a card to the Pile
Thanks



LinkBack URL
About LinkBacks


