I'm reading about two-dimensional and multi-dimensional arrays at the moment in order to better organize user input. I'm trying to create a function that can store a card player's hand. At the moment I'm just brainstorming how it would look and writing out some notes to myself to organize it in plain english before I break it down into C++.
So far I've figured this:
I'm going to use a two-dimensional array to store cards in a dealt hand. I figured it would have two columns, one to store the card's value and one for its suit. So something like this:
string cardArray[row][col]; //Where row is however many cards are in the hand
I'm not quite sure if string is the right data type to go about this.
In program execution I want the user to enter suit (S for spade, H for heart, D for diamond, and C for club) followed by a space then the face value in int form (1-13 with the Ace as 1, Jack as 11, Queen as 12, and King as 13).
Since the suit is a char/string and the face value is an int I wonder if it would be best to create two seperate one-dimensional arrays for suit and value then use a cin statement to store the values. My only concern is being able to call on the values and compare them against each other to determine little flags (only card in suit or no cards in a specific suit for example).
Any help to consolidate the ideas swarming around in my head would be much appreciated.