C + + lesson Three (2013.10.03)

Source: Internet
Author: User

Default parameters for the function:

1. The default parameter of the function must be placed to the right of the formal parameter and cannot appear on the right side of the default parameter without the default parameters

2. If the declaration of a function gives the default argument, the implementation of the function cannot define the default parameter

3. When declaring a member function, the default argument is not given, and the implementing member function has a default parameter, which may not be visible at the time of the call (when the function implementation is placed in front of it),

4. Therefore, the default parameters are usually placed in the. h Declaration

Polymorphic---> Overloading (Overload)

The implementation principle of overloading: function name smash

How to find the function name smash:

In the code, declare a function not to implement it, but in the main function to call the function, and then compile, connect to check the code, in the wrong hint can see the name of the function's crush.

C + + lesson Three (2013.10.03)

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.