// Program file: stringct2.cpp // Demonstrates the use of the string class operators // by doug #include using namespace std; int main() { string hand[5]; string card; string value("23456789TJQKA"); string suit("SHCD"); for (int i = 0; i < 5; ++i) { int v = rand() % 13; int s = rand() % 4; card.assign(value,v,1); card.append(suit,s,1); cout << card << " " << value[v]<< " " << suit[s] << " " <<','; hand[i] = card; } cout << endl; for (int i = 0; i < 5; ++i) cout << hand[i] << ','; cout << endl; system("pause"); return 0; }