May 2002
Beginner
320 pages
6h 18m
English
The idea of overloading is to use the same name for more than one function in a class.
This can be useful when you have separate names for functions that do essentially the same thing, but differ only in the number or types of arguments required. For instance, anExternalInterface has member functions DisplayText(), DisplayRequest(), and DisplayNumber(). Wouldn't it be nice to be able to just call a function named Display() and have the compiler figure out which implementation to call based on the arguments provided?
C++ makes this fairly simple.
For instance, to the compiler, the following declarations represent separate and distinguishable member functions of anExternalInterface, despite having ...
Read now
Unlock full access