C ++ primer plus Study Notes (1)

Source: Internet
Author: User

1. Function header (AS Interface)

The function header describes the interface between a function and the function header that calls it.

For example, main ():

The function header describes the interface between main () and the operating system.

Who is the return value (exit value) of int main?

A: Return to the operating system.


2. c ++ pre-processor

Like C ++, C ++ also uses a pre-processor that processes the source files before compilation.

For example: # include <iostream>

This compilation command causes the pre-processor to add the content of the iostream file to the Program (replacing the code line # include <iostream> in the program ).


3. Class Introduction

Class is a user-defined data structure.

Classes are for objects, just like types are for variables.

Class describes all the attributes of a data type. An object creates an object based on these descriptions.


4. The program can access the namespace STD method:

1. Using namespace STD; before function definition. (All functions in the file can be used)

2. Using namespace STD; put it in a specific function definition (this function can use STD ).

3. Use a Compilation instruction similar to Using STD: cout in a specific function.

4. Do not use the compilation command using. Use the prefix STD: for example, STD: cout <"yes" when you need to use the element of the namespace STD ".

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.