How to create simple poker hand class in C++
I am having a hard time constructing my hand class and for some reason I
keep getting an error about my _card[] is an undeclared identifier. Can I
get some help with this? As you can see I tried my effort in the hand
class. And I also I should mention that we are just now learn inheritance
for C++;
//card.h
#define Card_H
#include <string>
#include <iostream>//cout and cin
using namespace std;
//types of card
typedef enum Suit_t
{
club = 1,
diamond,
heart,
spade
}Suit_t;
//value each card holds
typedef enum Rank_t
{
two = 1,
three,
four,
five,
six,
seven,
eight,
nine,
ten,
jack ,
king ,
queen ,
ace
}Rank_t;
// card class
class Card
{
private:
Suit_t _suit;
Rank_t _rank;
public:
Card();//constructor that has no parameters
Card(Suit_t suit, Rank_t rank);//2nd constructor
//getters
Suit_t getSuit() const;
string getSuitName() const;
Rank_t getRank() const;
int getRankValue() const;
string getRankName() const;
};//card class
No comments:
Post a Comment