Thread: help me with first program

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    4

    help me with first program

    help

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    4
    please help i need help!

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    4
    hurry, please help me! i must turn this in in a minute!

  4. #4
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    Yes, you do...

    Here's a hello world program for you... Beyond that, I can only advise picking up a book and reading. Also, don't reply to your own posts 5 minutes after you make them.

    Actually - I'm going to let you flounder. This program can be done in 2 seconds if you actually pick up a book, and since you've already bumped this thread twice, I'll just let you suffer.

  5. #5
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    You need to have...

    #include <iostream.h>

    ...before main().

    Your main() should return an int i.e.

    int main()

    Strings need to be in double quotes and statements within your main() need a ; after them eg...

    cout << "Hello World!";
    return 0;
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  6. #6
    Registered User
    Join Date
    Jan 2002
    Posts
    68
    HaHa...you sure do.

    main()
    {cout<<hello world
    return 0}

    How about this:

    cout is an object, and objects arnt built in. Its defined elsehwere, so to start you need:

    include<iomanip.h>

    next prob...your returning 0, but main isnt set to return anything...heck its not even set as void...and it takes no params, spo that should be void...so...

    int main(void)

    and lastly...code lines end in a semi colon.

    Putting it all together...
    Code:
    include<iomanip.h>
    
    int main(void
    {
         cout << "Hello World";
         return 0;
    }
    Last edited by TrojanGekko; 02-22-2002 at 09:47 AM.
    ______________________
    The Gekko

  7. #7
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Sorry cheez, concurrence again, but I think that it is a first for me at least, that someone has bumped their thread twice while I was typing an answer. One for the record books huh? Guess no more help here. Now, let me see that IP address again...!
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  8. #8
    Registered User
    Join Date
    Feb 2002
    Posts
    4
    thanx u guys were more helpful than govtcheez
    and please dont hack me adiran...

  9. #9
    Registered User Paro's Avatar
    Join Date
    Feb 2002
    Posts
    160

    Talking

    lol thats the funniest program i ever saw! we actually read the first chapter before we even got to turn on the computers in my class lol...

    and that hello world thing is in the main page of this site! you could have copied and pasted it...

    well i guess we were all newbie once...and i still am...but this is ridiculous
    Paro

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 01:38 PM
  2. Need help with a program, theres something in it for you
    By engstudent363 in forum C Programming
    Replies: 1
    Last Post: 02-29-2008, 01:41 PM
  3. Replies: 4
    Last Post: 02-21-2008, 10:39 AM
  4. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM