I wanna add the Computer as a Player, if there are only 3 player who play the game.
My first try was this:
cout << "How much players? : ";
cin >> numberofplayers;
string computer = "Computer";
string* players = new string[numberofplayers];
if (numberofplayers== 3)
for (int i = 0; i < numberofplayers; i++)
cout << "players " << i + 1 << ", tell me your name: ";
cin >> players [i];
players  = computer;
cout << "Player 4 is the computer! " << endl;
my goal is now to see all players :
for (int i = 1; i <= numberofplayers; i++)
cout << players[i] << "\t";
My problem is now that i can not see the 4th player which ist the Computer.
Can someone can tell me how i can see the Computer as a player?
I think you are off by one.
an array is indexed from zero, which you seem to know: your for loop is correct. But you mess with players which is the FIFTH PLAYER. Player 4 is  because 0,1,2,3 is 4 things... right?