Parse Error

ToneeTonee Wub wuBUK Join Date: 2003-10-25 Member: 21926Members, Constellation
Yes I am learning C++, getting stuck on the hello world is some what noobish but so what <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->

Here's the problem, I don't understand it

Comments

  • ToneeTonee Wub wuB UK Join Date: 2003-10-25 Member: 21926Members, Constellation
    sorted, had a ; after main :x

    thanks to Detritus! <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->
  • JimmehJimmeh Join Date: 2003-08-24 Member: 20173Members, Constellation
    Nice mod your downloading there Sir Tonee
  • DrfuzzyDrfuzzy FEW... MORE.... INCHES... Join Date: 2003-09-21 Member: 21094Members
    Think you need to remove the tabbed spaces behind {

    And maybe add { behind each string between the first { and last }

    /me shurgs, i only know .qc quakec <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->
  • RobRob Unknown Enemy Join Date: 2002-01-24 Member: 25Members, NS1 Playtester
    Yeah, you've got it. Just remember that a ; after a function delcaration means it's a prototype to be defined later.
  • brute_forcebrute_force Join Date: 2003-10-04 Member: 21433Members, Constellation
    Hmm, long time since I used C++, and I might be totally wrong, but shouldn't that be "std::cout <<"? Atleast that's what the book told me <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo-->
  • Dorian_GrayDorian_Gray Join Date: 2004-02-15 Member: 26581Members, Constellation
    edited July 2004
    If you want it to be uber-perfect, yeah, or declare the namespace, but cout works just as well. It varies by book on how they teach you.

    Edit: Also, the slash is the wrong way. / is just a slash, while \ is the escape character. So it would be \n, and \\ for a backslash.
  • HibameHibame Join Date: 2003-11-16 Member: 22974Members, Reinforced - Shadow
    edited July 2004
    Im learning c++ too (teaching myself ^^) but iv had previous work in java and the both are alike in some ways and were using the same editor o.O h4x
  • Dorian_GrayDorian_Gray Join Date: 2004-02-15 Member: 26581Members, Constellation
    Yeah if anyone tries to tell you that programming in Java is simpler than C++, tell them to go stick their head in a pig. Every single basic command in Java is about 16 times as long as C++. Eg: to output "Natural Selection"
    C++: cout << "Natural Selection";
    Java: System.out.println("Natural Selection");

    It's even worse when dealing with a GUI. For example, a simple Yes/No dialog:
    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->JOptionPane.showInternalConfirmDialog(frame,"Please choose one", "information",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.INFORMATION_MESSAGE);<!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
  • HibameHibame Join Date: 2003-11-16 Member: 22974Members, Reinforced - Shadow
    Sorry to hijack the thread but Hibame has a c++ problem too

    Im making a console app (no extra mubo for now) and it closes automaticly (I tryed cin>>get(); as the help file said to do but it doesnt pause the program. So my question is is there a way to pause the program to read text then hit any key to continue (or will I read it later in the book about something like grabing key input from ASII code or something like that)?
  • SwiftspearSwiftspear Custim tital Join Date: 2003-10-29 Member: 22097Members
    <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo--> its been a while...

    Hibame, you could just add a useless cin statement with variable info that doesn't do anything. Although that solution will cause any key except the enter key to print text...
  • HibameHibame Join Date: 2003-11-16 Member: 22974Members, Reinforced - Shadow
    <!--QuoteBegin-Swiftspear+Jul 31 2004, 04:26 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Swiftspear @ Jul 31 2004, 04:26 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html//emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif' /><!--endemo--> its been a while...

    Hibame, you could just add a useless cin statement with variable info that doesn't do anything. Although that solution will cause any key except the enter key to print text... <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    I thought of that and thats exactly why I didnt want to do it =/
  • brute_forcebrute_force Join Date: 2003-10-04 Member: 21433Members, Constellation
    <!--QuoteBegin-Hibame+Jul 31 2004, 10:17 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Hibame @ Jul 31 2004, 10:17 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Sorry to hijack the thread but Hibame has a c++ problem too

    Im making a console app (no extra mubo for now) and it closes automaticly (I tryed cin>>get(); as the help file said to do but it doesnt pause the program. So my question is is there a way to pause the program to read text then hit any key to continue (or will I read it later in the book about something like grabing key input from ASII code or something like that)? <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    I don't know of a way to fix it, but if you want you could start it via the command prompt, which will let you see the last line.
Sign In or Register to comment.