Hello World Program

Discussion in 'C++' started by rhle.freak, Nov 29, 2007.

  1. rhle.freak

    rhle.freak Guest

    int main(void)
    std::cout << "Hello World" << std::<<endl;
    return 0;

    I am compiling it on my linux box (rhel 5) using g++ hello.cpp -o
    hello.o and
    to my astonishment i am getting the following errors!

    hello.cpp: In function 'int main()':
    hello.cpp:5: error: expected unqualified-id before '<<' token
    hello.cpp:5: error: 'endl' was not declared in this scope

    It does look to be a very stupid question ,please pardon me for my
    in using Linux n g++ .Kindly help me out..
    rhle.freak, Nov 29, 2007
    1. Advertisements

  2. rhle.freak

    rhle.freak Guest

    it should have been <<std::endl;
    My fault..Please ignore the message
    rhle.freak, Nov 29, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.