"C + + Primer 5th" Chapter 1

Source: Internet
Author: User

1. Each C + + contains at least one function, one of which must be the Mian function, and the return type of the main function must be int.

2. Function definition includes: return type, function name, parameter list, function body

3. The return value of the main function is used to indicate the state, 0 indicates success, and the other value meanings are defined by the system and are typically used to represent the error type.

4. The main function return value can be obtained through the echo command.   Unix:echo $? Windows:echo%errorlevel%,

5. The standard library has four IO objects, Cin,cout,cerr (warning error, no buffering), clog (general information, buffering). The default CIN and Cerr flush the cout buffer. The cout buffer is not refreshed when the program terminates abnormally. The action of the read-write buffer is irrelevant to the action in the program.

6. #include指令和头文件名称必须在同一行, and the instruction must be outside all functions.

7. The << and >> results are the left operand.

8. The write Endl effect is to end the current row and flush the contents of the buffer associated with the device to the device. You should always keep flushing the stream, or the output may remain in the buffer if the program crashes.

9. Namespaces can avoid inadvertent name definition collisions, and conflicts caused by using the same name in the library. The standard library defines that all names are in the namespace STD, that is, calling the standard library explicitly describes the scope std::. By using the scope Operator:: to indicate the name in the specified namespace.

10. There are two types of annotations: single-line comment and qualifier pair comment. The comment qualifier can contain any content except/*. Comment Qualifiers cannot be nested.

11. When a file terminator is encountered or an invalid input is encountered, the state of the IStream object becomes invalid, that is, false. Windows:ctrl+z, then press ENTER or return key; unix:ctrl+d

12. File Redirection: Additems <infile>outfile

13. member functions are functions that are defined as part of a class and are sometimes referred to as methods.

14. The point operator can only be used for objects of class type.

"C + + Primer 5th" Chapter 1

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.