Getting Started with C + + First day (Hello world)

Source: Internet
Author: User

From today onwards, began to learn C + + language, to set a goal for themselves, is to take every day to learn things to do notes, record their own learning process, also in order not to give themselves lazy opportunities, haha.

。。。。。

Open VS2015, create engineering and source files, write the first HelloWorld program

  

1 #include <iostream>2 3 using namespace std;4 5 int{7   cout << "Hello world!" << endl;
      8   return 0;      9}   

Successfully printed Hello world!, heart excited. The following analysis of this program

#include <iostream> is used to include the C + + standard Input Output header file (same as the C language, # include <stdio.h> function).

using namespace Std; The use of namespaces, which is introduced by C + +, is mainly to solve the problem of duplication of variable names and function names in large projects.

cout<< "Hello world!" << Endl; Print Hello world!

This Hello world! program although short, but embodies the C + + language and C language differences, so, when learning C + + language, should be correct attitude, with a new way of thinking to see C + +, while comparing C and C + +, in the process of learning C + +, enhance the C + + The understanding.

Getting Started with C + + First day (Hello world)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.