C/C++ - Hello World (very simple) - Page 2-VBForums
Page 2 of 2 FirstFirst 12
Results 41 to 43 of 43

Thread: C/C++ - Hello World (very simple)

  1. #41
    Addicted Member
    Join Date
    Jul 2002
    Location
    Toronto, ON Canada
    Posts
    153

    Re: C/C++ - Hello World (very simple)

    Quote Originally Posted by Maven
    Interesting. Thanks for the link.

  2. #42
    Hyperactive Member Maven's Avatar
    Join Date
    Feb 2003
    Location
    Greeneville, TN
    Posts
    274

    Re: C/C++ - Hello World (very simple)

    Quote Originally Posted by yitzle
    Interesting. Thanks for the link.
    For small applications, I do not think that endl or '\n' will matter much. When you begin writing intensive io applications, it will become very important to have tighter control on your buffering. If you was writing a web application with fastcgi, for example, then it becomes critical to control output. While a web application in C++ is far away from novice level, it's a good idea to start developing understanding of buffering.
    Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde

  3. #43
    Banned
    Join Date
    Mar 2009
    Posts
    17

    Re: C/C++ - Hello World (very simple)

    Quote Originally Posted by BeholderOf
    Code:
    #include <iostream.h>
    
    int main()
    {
    
    //This prints "Hello World" and <<endl makes a new line
    cout<<"Hello World"<<endl;
    
    return 0;
    }
    Explaination:

    "#include <iostream.h>" - This is the header for cout/cin, in other words we include iostream.h so we can use the functions cout<<, and cin>>.

    "int main()" - this is where our program actually starts.

    "cout<<"Hello World"<<endl;" - This is what actually prints the text to the screen.

    Just a simple example !
    This is the basic of c++. Every one know about it...

Page 2 of 2 FirstFirst 12

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.