Thread: Problem in C++

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    4

    Problem in C++

    i keep having "Statement missing ;" in lines 64, 78, 124, 138, 152 and "Compound statement missing }" on lines 274, 275
    here's my code (it's kinda long but please help me) Hoping for replies. Thank you all in advance.

    Here's the source code: C..C

  2. #2
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    Mate i am not surprised given the open close braces style you have adopted, its just a case of finding it yourself i would say, there is no magic here, the error is pretty verbose in this case, one could be causing the other to generate but i bet one or the other of them is literally true

    Hold on maybe its a ton of other things too...like there are consitently no spaces in else..if

    also its

    int main()
    Last edited by rogster001; 08-17-2011 at 09:42 AM.
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    4,632
    First there is no elseif keyword it should be else if (notice the space). Second you have some extra semicolons following your else if() clauses (before the opening braces).

    Jim

  4. #4
    Registered User
    Join Date
    Aug 2011
    Posts
    4
    Sorry, I just started in programming and I don't know the rule about having a ; after an else if statement. After I put ; on every else if, new errors came which denotes "Misplaced Else"

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    The reason you don't know such a rule is because that is the opposite of the rule: you are forbidden to have semicolons after else if.

  6. #6
    Registered User
    Join Date
    Aug 2011
    Posts
    4
    well, the person above said after the else if clause.

  7. #7
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Actually, the person above told you not to do that:

    Quote Originally Posted by jimblumberg View Post
    First there is no elseif keyword it should be else if (notice the space). Second you have some extra semicolons following your else if() clauses (before the opening braces).
    Jim
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  8. #8
    Registered User
    Join Date
    Aug 2011
    Posts
    4
    eff. I misunderstood. D:

  9. #9
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    For future reference, for C questions post in the C board. This is the C++ board. The name at the top of the forum should give it away.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strcmp problem, whats the problem, i cant figure it out!
    By AvaGodess in forum C Programming
    Replies: 14
    Last Post: 10-18-2008, 06:45 PM
  2. Replies: 4
    Last Post: 10-16-2008, 07:30 PM
  3. Replies: 27
    Last Post: 10-11-2006, 04:27 AM
  4. syntax linked list problem & struct problem
    By beely in forum C Programming
    Replies: 5
    Last Post: 11-11-2002, 09:14 AM
  5. Texture Problem(I got the NeHe tut working, but I have a problem)
    By SyntaxBubble in forum Game Programming
    Replies: 2
    Last Post: 12-02-2001, 10:40 PM

Tags for this Thread