Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
// main3b.cpp
// This holds a number game
// Copyright (c) 1998
///////////////////////////
#include <iostream.h> // For input/output
#include <fstream.h> // For file input/output
#include <string.h> // For strcpy
#include <time.h> // For time
#include <stdlib.h> // For toupper and tolower
// The main function of our number game
int main(void)
{
using namespace std;
int PlayersAmount;
string Player("");
cout<<"Welcome to MultiPlayer Strategy by Cameron McKinnon. Enjoy!\n\n\nOkay, time to start the game! First, you're going to have to answer some \nquestions.\n\n\n***\nHow many people will be playing?\n***\n\nNumber of players: ";
cin>>PlayersAmount;
cout<<"\n";
int count = 0;
while(count<PlayersAmount)
{
string Player; //note: the [] appears after the variable
//populate array:
string Currentplayer("");
int saycount=count+1;
cout<<"Player "<<saycount<<", please enter your desired username: \n\n";
cin>>Currentplayer;
Player[saycount] = Currentplayer;
count ++;
}
cout<<"\n\n";
system("PAUSE");
return EXIT_SUCCESS;
}