Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    Oct 2003
    Location
    Kissimmee, Fl
    Posts
    497

    The answers there, i just dont see it...

    So im a VB guy, so its not like ive never coded before, but i dont know what im doing wrong.
    I pick these c++ VtMs up and download a copy of Visual C++ express 2005(beta) form microsoft. I start up the intro video starring Mr Busby and Joel and start my first C++ program, Hello world...perhaps the most basic program one can do, exspecialy if everything is being done in front of you.
    Well i found away to mess it up. Heres my code...



    #include <iostream>
    main()
    (
    std::cout << "Hello World" << std::endl;
    )

    and here is my error message...


    ------ Build started: Project: Hello World, Configuration: Debug Win32 ------
    Compiling...
    Hello World.cpp
    c:\Documents and Settings\Ted\My Documents\Visual Studio\Projects\Hello World\Hello World\Hello World.cpp(5) : error C2143: syntax error : missing ')' before ';'
    c:\Documents and Settings\Ted\My Documents\Visual Studio\Projects\Hello World\Hello World\Hello World.cpp(5) : error C2072: 'main' : initialization of a function
    c:\Documents and Settings\Ted\My Documents\Visual Studio\Projects\Hello World\Hello World\Hello World.cpp(6) : error C2059: syntax error : ')'
    Build log was saved at "file://c:\Documents and Settings\Ted\My Documents\Visual Studio\Projects\Hello World\Hello World\Debug\BuildLog.htm"
    Hello World - 3 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


    Any ideas? I really appeciate any help anyone can give me.

  2. #2
    Join Date
    Jun 2003
    Posts
    140
    (
    std::cout << "Hello World" << std::endl;
    )
    Change the (.....) for { } and you should be fine.

  3. #3
    Join Date
    Mar 2004
    Location
    England, Berkshire
    Posts
    3,015
    Originally posted by EatinDonuts


    Change the (.....) for { } and you should be fine.
    yeah they say use curly braces


    jake.hall@gmail.com Got Xbox live? Add me. DuDeY109

  4. #4
    Join Date
    Oct 2003
    Location
    Kissimmee, Fl
    Posts
    497
    Thanks guys, it works.....silly me. So now its succesful, no errors...but with this crazy beta version of Visual C++ 2005 ctrl-F5 doesnt work, and f5 runs it, but a little black box pops up real quick then goes away.
    Any good free compilers out there you guys could suggest?

  5. #5
    Join Date
    Jul 2004
    Location
    USA
    Posts
    820
    Originally posted by DakTanis714
    Thanks guys, it works.....silly me. So now its succesful, no errors...but with this crazy beta version of Visual C++ 2005 ctrl-F5 doesnt work, and f5 runs it, but a little black box pops up real quick then goes away.
    Any good free compilers out there you guys could suggest?
    Ahhhhhh. Check the stickies. You need:
    Code:
    system("pause");
    At the end of you code inside main.

  6. #6
    Join Date
    Jan 2004
    Location
    South Pole
    Posts
    1,519
    Read the FAQ! (Quickly, before you get flamed! )

  7. #7
    Join Date
    Oct 2003
    Location
    Kissimmee, Fl
    Posts
    497

    Thumbs up

    Thanks for you help. I appologize for not reading the FAQ first, will do from now on.

  8. #8
    Join Date
    Dec 2003
    Posts
    5,564
    Originally posted by DakTanis714
    Thanks for you help. I appologize for not reading the FAQ first, will do from now on.
    Not a problem at all. Hope you do read them they are very good I recommend to every body read them.
    JapanGaku - Blog about Japan, J-Drama, and the Japanese Language
    BuddyLindsey.com - My Development Blog

  9. #9
    Join Date
    Jan 2004
    Location
    South Pole
    Posts
    1,519
    And welcome to the site!

  10. #10
    Join Date
    Nov 2003
    Location
    Nova Scotia, Canada
    Posts
    96
    I don't think anyone has ever been flamed on this forum. I would say most of the peeps on here are either very polite or they are properly medicated.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •