1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
#include <iostream>
using namespace std;
void *build_deck(); // Builds the deck.
int main()
{
int DECK_SIZE = 52;
char *ptr;
ptr = build_deck();
for (int i = 0; i < DECK_SIZE; i++)
cout << ptr[i] << endl;
system ("PAUSE");
return 0;
}
void *build_deck()
{
char *arr;
arr = new char [52];
char arrays [52]= {'CA', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8', 'C9', 'C10', 'CJ', 'CQ', 'CK',
'DA', 'D2', 'D3', 'D4', 'D5', 'D6', 'D7', 'D8', 'D9', 'D10', 'DJ', 'DQ', 'DK', 'HA', 'H2',
'H3', 'H4', 'H5', 'H6', 'H7', 'H8', 'H9', 'H10', 'HJ', 'HQ', 'HK', 'SA', 'S2', 'S3', 'S4',
'S5', 'S6', 'S7', 'S8', 'S9', 'S10', 'SJ', 'SQ', 'SK'};
arr = arrays;
return arr;
|