The string matters only to the player, since for the computer it is just a waste of memory over the int solution.
However, I suggest you use the enumerations:
enum Suit {Hearts, Clubs, Spades, Diamonds}; enum Rank {Two, Three, Four, Five, Six, Seven, Eight, Nine, Ten, Jack, Queen King, Ace};
Note that enumerations start at 0 and add 1 if nothing is specified, so they are in perfect order, it just happens that they are better represented as with int.
using the to_string method:
string toString(const Suit){ switch(Suit){ case Hearts: return "Hearts"; et cetera
with
class Card { public: Card(const Suit suit, const Rank rank);
This class card is the perfect container as it is. There is no need to change it into a string, at least not if you do not want to print it.
Now for the interesting part:
First of all, I would do Hand to be something that either returns Deck ("create hand"), or Deck receives one and only constructor from it. A hand should always be created with five cards, and this should only be possible. The deck should always be an independent facility.
I would give the Hand a Card vector. No need for string. Makes everything easier.
As auxiliary methods, I would add a method that creates a vector that takes into account the multiplicity of each rank. From this you can easily get a vector that counts how many doubles, there are triples and quadruples. And if you have it, you are ready. So do the following:
enum HandValue {HighCard, Pair, ThreeOfAKind, FourOfAKind, FullHouse }; class Hand //note that I omitted some methods that are not relevant for the answer { private: vector<Card> cards; vector<unsigned int> multiplicityOfRank() const; vector<unsigned int> components() const;
components can be similar to position 0, maintaining the number of doublings, position 1 - triples, position 2 - quadrupoles
Does it help? Still have questions?
(By the way, personally, I prefer not to write namespaces if the namespace is obvious - do you know about using , as in using std::vector; ;? Do not use using namespace std; as in this main, std is too large to exclude conflicts names.)