C ++ Primer Learning Ninth Chapter 9 - Do you really know when is overloaded?

xiaoxiao2021-03-06  65

Do you really know why you want to overload?

Let's go straight:

Q: What is the principle of named function?

A: Of course, it is the best word that describes the functionality of functionality!

If I want to put some things on the screen, such as alphabet strings, string letters, moonlight box ...

Do this:

Int charPrint ();

Int strprint ();

INT mbprint ();

Still do this:

INT Print (Char &);

Int Print (String &);

Int Print (Moonbox &);

Of course, of course, the latter is good, my memory is poor, can't remember so much function name!

For the constructor of the function:

The overload may be the only choice - you are my only! For advanced topics for overload, please see Meyers' "EC", after all, only Meyers know what you are saying!

转载请注明原文地址:https://www.9cbs.com/read-90013.html

New Post(0)