Function rewriting, overloading

Rewriting:
Function rewriting is actually function coverage. When you declare a member function in a derived class that is exactly the same as the base class function, you have already overwritten the base class function (non-virtual function). in fact, out of time with the derived class is a function of the
overload:
the number of parameters, types, return values can not be exactly the same name and
the same general function name can only handle a class data type but can handle a variety of data overload type
Examples
int the Add (int a, B int);
int the Add (int a, a float B);
main () {
the Add (5,3);
the Add (5,3.3);
}
? understand it
void fun (int x );
void fun(float x);
void fun(float x, int y);
This is the function overloading, the parameters are different, but the function name is the same, but the return value is not the same ~ the
same function name, but the parameters are different , The system will determine the function to be dropped according to the parameter type or the number of parameters you input!

Use more and write more, naturally you can understand more slowly, so I told myself!

Guess you like

Origin blog.csdn.net/u010436133/article/details/47684035