char name (10);
cout <<"What is your name? ";
cin >>name;
cout <<"Hello, "<<name<<"!";
cout <<"What was your previous job? n";
cout <<"1 - Police Officer n";
cout <<"2 - Doctor n";
int pickjob;
cout <<"Pick your job: ";
cin >>pickjob;
switch (pickjob)
{
case 1:
cout <<"Oh, so you're a cop.... n";
break;
case 2:
cout <<"Good, we've always needed a medic n";
break;
Default:
cout <<"error- invalid text; only 1 or 2 allowed.n";
}
{
int pickhandgun;
cout <<"Welcome to our encampment ";
cout <<"Which gun would you like? n";
cout <<"1 - 9mm Handgun n";
cout <<"2 - 44. Revolver n";
cout <<"Pick your handgun: ";
cin >>pickhandgun;
switch (pickhandgun)
{
case 1:
cout <<"Like to go with the basics, eh? n";
break;
case 2:
cout <<"There is nothing like the sound of a 44.! n";
break;
default:
cout <<"error-invalid text; only 1 or 2 allowed.n";
}
}
Returning a non-zero value usually means there was an error, you probably want to return 0.
Also, you realize that none of your choice cases will loop if you input an invalid value, right?
Anyway, since you don't really have much code, I would suggest trying an OO approach where you have a room class that contains some information (such as exits to other rooms). Then you can just have a pointer to the current room they are in and move it around as needed. This pointer should probably be part of a player class which contains all of the player's information.
EDIT: Oh, and char name(10) doesn't make an array, it makes a single character...use an std::string.
Fire, I think if he writes code like that in the first place he isn't yet far enough to even consider using an OO approach. Looks to me like he doesn't even know how to use functions yet.