Re: If else

  • From: "R Dinger" <rrdinger@xxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 9 Feb 2011 14:55:33 -0800

Hi,

I just noticed you have a semicolon on your if statement:
snip ...
if direction=="south";
... snip

That will give you much silent grief.

Richard
----- Original Message ----- 
From: Kristoffer Gustafsson 
To: programmingblind@xxxxxxxxxxxxx 
Sent: Wednesday, February 09, 2011 2:07 PM
Subject: If else


Hi.
Now I've decided that I'll learn to do things both without goto, and with it. 
Because then I'll maybe discover that goto is bad:)
I got one last code question today.
I need so that my program can do more than one action. for example of writing a 
text adventure you want many.
I've managed to put an if statement in my code. for example
if direction=="south";
{
cout<<"you go south.";
}
Now if I want to go north, how can I do that?
I tried if else, but it only says "expected primary expression before else 
expected.
Can you help me with this please?
/Kristoffer
  • References:
    • If else
      • From: Kristoffer Gustafsson

Other related posts: