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 31 32 33 34 35 36
|
int nrOfStrings = 0;
string *game = nullptr;
game = new string[nrOfStrings * 2];
const int CAP = 20;
string str[CAP] = { "Apple", "Banana", "Peach", "Lemon", "Coconut", "Mango", "Orange", "Avokado", "Cracker", "Cake", "Chocolate", "Car", "Bus", "Bird", "Airplane", "House", "Umbrella", "Cat", "Dog", "Mouse" };
bool *answer = nullptr;
string choice = "";
cout << "How many words do you want to use? " << endl;
cin >> nrOfStrings;
cout << "Words in use are: ";
/*for (int i = 0; i < nrOfStrings; i++)
{
cout << str[i] << " ";
}
cout << endl;*/
/*for (int i = 0; i < nrOfStrings; i++)
{
cout << str[i] << " ";
}
cout << endl;*/
for (int i = 0; i < nrOfStrings*2; i++)
{
game[i++] = str[i];
cout << game[i] << " ";
}
cout << endl;
return 0;
|