Forloop help

I need help with this function it will use a for loop to run through each player until it reaches the number of players and ask for the player’s name. The
name for each player will be entered into the string array called names.
Im not good with for loops they make no sense to me.
Last edited on
Where are you stuck?
Here you get some basic help with sense;)
http://www.cplusplus.com/doc/tutorial/control/
the whole function i guess. I have all the structure laid out i just don't know how to work the for loop.
1
2
3
4
5
	void getPlayerNames(int,  string[])
		{
		for(int players = 0; players < 20; 
                
                 

thats all i got so far.
//variable number showing the number of players
for(int player=0; player<number;player++){
cout<<"Enter "<<player+1<<" name : ";
gets(names[player]);
cout<<endl;
}

//hope this work :)
Thank you very much i do believe that will work perfectly!!!!
welcome my dear :)
Topic archived. No new replies allowed.