Problem with Hello World

This is a discussion on Problem with Hello World within the C++ Programming forums, part of the General Programming Boards category; I've made this work before, but now when I try the hello world program and use start without debugging it ...

  1. #1
    DmD
    DmD is offline
    Registered User
    Join Date
    May 2005
    Posts
    6

    Problem with Hello World

    I've made this work before, but now when I try the hello world program and use start without debugging it just says the "Press any key to continue..." message.
    Code:
    #include <iostream>
    using namespace std;
    
    int main()
    {
    	cout << "Hello World";
    }

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    add the "<< endl" part to the end
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    DmD
    DmD is offline
    Registered User
    Join Date
    May 2005
    Posts
    6
    Thanks, it works now.

  4. #4
    Registered User
    Join Date
    May 2005
    Posts
    50
    Lol, how the hell does endl fix that, ???

  5. #5
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    endl is a constant that tells the object cout to flush the buffer and move to the next line. if the buffer is not flushed, it won't make it to the screen.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bin packing problem....
    By 81N4RY_DR460N in forum C++ Programming
    Replies: 0
    Last Post: 08-01-2005, 05:20 AM
  2. Words and lines count problem
    By emo in forum C Programming
    Replies: 1
    Last Post: 07-12-2005, 03:36 PM
  3. Hello World Problem
    By khotwadi in forum C++ Programming
    Replies: 9
    Last Post: 06-12-2005, 01:04 PM
  4. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM
  5. binary tree problem - help needed
    By sanju in forum C Programming
    Replies: 4
    Last Post: 10-16-2002, 05:18 AM

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