• Advertisement
Sign in to follow this  

string compasion crashes

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


void Console::console(Person& p)
{
   cin>>command;
   if(command.compare("-skip"))
      Person::skipQuestion(p);
   else if(command.compare("-prev")
       Person::prevQuestion(p);

}

This crashes i dont know why. It works when i delete the second comparison. But when they are both together it doesnt work.. WHY!!!

Share this post


Link to post
Share on other sites
Advertisement
I just noticed that you're missing the closing parenthesis on the else if statement. Have you tried echoing back the value of command to ensure that it's being filled correctly?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement