Day 1: Introduction

Source: Internet
Author: User

1.1 Why use a language like C ++

 
Conciseness
Maintainability
Portability
1.2 The compilation process

Sorce file >>> Prcessed code >>> Object file
 
1.3 General notes on C ++

 
Case sensitive
2.1 hello world

Cpp Code
/*
* File: main. cpp
* Author: Gong Li
*
* Created on June 24,201 1, PM
*/

# Include <iostream>

Using namespace std;

/*
*
*/
Int main (){
Std: cout <"Hello, world! ";
Return 0;
}
 
2.2 Tokens

Keywords, identifiers, literals, operators, punctuation, whitespace
 
2.3 Explaination

 
Comment: //... or /*....*/
# Include: the preprocessor dumping in the content of another file.
Int main () {}: execute when the program starts up
Cout <: outputting some piece of text
Namespaces: like std shortdes a group of idemntifiers
Strings: Hello, world!
Escape sequence :...
Return 0: tell the OS it has completed successfully
 
3 Input

Input cin> x

Output cout <"hello"

Related Article

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.