This is the code where I tested the new input statement:
Code:
int play()
{
bool ok=false;
beaten=0;
hp=10;
maxhp=10;
weapon=0;
gold=5;
frags=0;
do
{
cout<<"What is your charater's name?\n";
getline( cin, yourname);
cout<<"Your character's name is "<<yourname<<". Is that okay?\n";
cin>>choice;
if (choice=="No" || choice=="no" || choice=="NO" || choice=="n" || choice=="N")
{
ok=false;
}
else
{
ok=true;
}
}while (ok==false);
startroom();
if (hp==0)
{
cout<<"Ye dead. Better luck next time!\n";
system ("pause");
}
}
yourname is a string, and since this is the only code block I tried the new method in, this has to be the area where the error is occurring.