I am going to write an enumerated type that identifies the suit of the jail cell. However, it should be from another class - Card.
I tried to code it like that
I think it is not going to work, can anyone gives me some suggest?Code:enum card::suit; //an enumerated type (located in the Card ADT) that identifies the suit of the jail cell
Here is the code from card.h
appericate it.Code:#include <iostream> using namespace std; class Card { public: enum Rank { ACE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT, NINE, TEN, JACK, QUEEN, KING }; enum Suit { SPADES, HEARTS, CLUBS, DIAMONDS }; Card(); // Default constructor will initialize to Ace of Spades Card( Rank newRank, Suit newSuit ); Rank getRank() const {return rank;} Suit getSuit() const {return suit;} void setRank( Rank newRank ); void setSuit( Suit newSuit ); private: Rank rank; Suit suit; }; ostream& operator<<( ostream& os, const Card& card );



LinkBack URL
About LinkBacks


