C ++ must understand 20 Basics

Source: Internet
Author: User

C ++It is a general programming language that checks static data types and supports multiple programming paradigms. It supports various programming styles such as process-based programming, data abstraction, object-oriented programming, and generic programming, such as creating icons. Here are some basic things, but they are also very important. Let's take a look.

C ++ basic knowledge:

1. AllC ++All programs must have a main () function, which is the start of program execution.

2. All variables must be declared before use

3. C ++ supports many data types, including integer and floating point types.

4. The output operator is <, used with the cout statement to output information to the screen.

5. The input operator is>, used with the cin statement to read information from the keyboard

6. The program ends at the end of the main () function.

7. All functions are mutually independent entities. functions cannot be nested with each other, but they can be called with the exception of the main () function)

8. Function Representation: The function name is followed by parentheses.

9. Form of calling a function: first, the function name, followed by a pair of parentheses, and finally a semicolon

10. When a function requires a parameter, the parameter is placed in parentheses after the function name.

11. When you use a library function, you must include the header file of the function in the program, because the header file provides a library function prototype.

12. The actual parameter (argument) is the value passed to the function when calling the function. The formal parameter (parameter) is the variable defined by the function to receive the actual parameter.

13. The term "actual parameters" (also referred to as parameters) in C ++ refers to the value used to call a function, and the variable that receives these values is called a formal parameter. In fact, parameters with actual parameters are usually called parameterized functions)

14. Remember that void is used only when the function does not return a value.

15. The standard C ++ does not use the "Default Integer type". Therefore, you should specify the return value type for each function.

16. if select between two execution paths

17. ++ is the incremental operator to add 1 to the operand. -- it is the decrement operator to subtract one from the operand.

18. code blocks are logically related statement units. Using code blocks to implement algorithms can make the idea of algorithms clearer and more efficient.

19. We recommend that you use the indent orchestration format when writing a program: indent the code after the braces begin. After the braces are completed, the Code indent orchestration format is restored to the format before the braces begin.

20. Remember, the keyword size is meaningful. C ++ is a case-sensitive language that requires all keywords to be lowercase.

Learning C ++ should be easy to difficult and step by step. For beginners with Zero Foundation, they should calm down and be impatient. It is not easy to become a C ++ master. It must be done with great efforts. I hope the above will be helpful to you.

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.