| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
" parse error before `else' " **URGENT**
Please help me on this as soon as you can. Thank you so much.
Quote:
I receive ' parse error before `else' ' errors at basically every 'else' line in the program. Thank you. |
|
#2
|
|||||
|
|||||
|
It should be something like this:
c Code:
Please consult your programming book on how if-then-else statements work and especially pay some attention to the use of code blocks with the curly braces {}... |
|
#3
|
|||||
|
|||||
|
Very simple, if you have an 'if' statement where you want more than one line of code to be conditional, you have to enclose them in braces { }.
Right now, only the first line of code after each if() statement is attached to the condition. The next line is normal code, and as such, the following 'else' can does not belong to any 'if'. Try this: cpp Code:
__________________
This is my code. Is it not nifty? "The biggest problem encountered while trying to design a system that was completely foolproof, was, that people tended to underestimate the ingenuity of complete fools." ---Douglas Adams Join the Itsacon fanclub! Zero Tolerance: Spammers banned so far: 280
![]() Last edited by Itsacon : October 4th, 2005 at 11:09 AM. |