Multiple values on an array

Hello, I need to make a memory game where I have a static array with max of 20 strings and then I need to allocate it to a dynamic array and have the words multiple by 2 so that they appear 2 times. The problem is I have no clue how to do that. I was hoping I could get some answers, here's how long I have gotten so far.

Apologize for my newbie coding, I recently started.

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;
Topic archived. No new replies allowed.