-
August 26th, 2009, 02:19 PM
#1
else if problem
Hi
Im fairly new to c++ and ive got stuck with else if statements. I keep getting"error: expected primary-expression before "else""
this is the code, i know its probably really simple i just cant work it out
if (xpgo==1)
xp--;
hp++;
cout<<"You hae added 1 xp to your HP!\n";
else if(xpgo==2)
xp--;
cout<<"You hae added 1 xp to your ATTACK!\n";
at++;
else if(xpgo==3)
xp--;
cout<<"You hae added 1 xp to your DEFENCE!\n";
def++;
else
cout<<"You have input and invalid number please try again\n";
thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|