weird compile errors

This is a discussion on weird compile errors within the C++ Programming forums, part of the General Programming Boards category; the following line does not give any errors: Code: QUESTION quest1 = {"How many wheels are on a car?","5.","A) 2 ...

  1. #1
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    weird compile errors

    the following line does not give any errors:
    Code:
    QUESTION quest1 = {"How many wheels are on a car?","5.","A) 2 B) 3 C) 4 D) 5 .", 4, false, &quest2, &quest1};
    .....yet this line gives 3 errors:
    Code:
        quest1 = {"How many wheels are on a car?","5.","A) 2 B) 3 C) 4 D) 5 .", 4, false, &quest2, &quest1};
    the error is with sytax:

    C:\Documents and Settings\Administrator\Desktop\ct\questions.cpp(23 8) : error C2059: syntax error : '{'
    C:\Documents and Settings\Administrator\Desktop\ct\questions.cpp(23 8) : error C2143: syntax error : missing ';' before '{'
    C:\Documents and Settings\Administrator\Desktop\ct\questions.cpp(23 8) : error C2143: syntax error : missing ';' before '}'

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    What is QUESTION defined as?
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User
    Join Date
    Sep 2001
    Posts
    305
    lol just have to say that your lines have absolutely no readability.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compile Errors in my Code. Can anyone help?
    By DGLaurynP in forum C Programming
    Replies: 1
    Last Post: 10-06-2008, 09:36 AM
  2. Strange compile errors
    By csonx_p in forum C++ Programming
    Replies: 10
    Last Post: 07-28-2008, 11:41 AM
  3. Compile errors in stl header files
    By Swordsalot in forum C++ Programming
    Replies: 2
    Last Post: 07-20-2008, 02:41 AM
  4. Compile Errors for CreateThread..
    By gopi_tony in forum Windows Programming
    Replies: 20
    Last Post: 10-22-2006, 09:58 AM
  5. weird errors gcc: functions like floor(), ceil(), sqrt()
    By gemini_shooter in forum Linux Programming
    Replies: 2
    Last Post: 06-04-2005, 08:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21