you could use <map> to map the loop counter i with a string. A simple example, uses an array of maps to represent the 4 kinds of cards.
#include <iostream>
#include <string>
#include <map>
using namespace std;
map<int, string> deck[4];
int main()
{
deck[0][1] = "Ace of Spaces";
deck[1][1] = "Ace of Clubs";
deck[2][1] = "Ace of Diamonds";
deck[3][1] = "Ace of Hearts";
string kind = deck[2][1];
cout << kind << "\n";
}
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,945 posts
since Aug 2005