April 2011
Beginner
464 pages
9h 18m
English
In Hour 5, “Calling Functions,” you learned how to implement function overloading by writing multiple functions with the same name but different parameters. Member functions also can be overloaded.
This is demonstrated by the Rectangle program in Listing 14.1, which implements a Rectangle class that has two drawShape() functions. One takes no parameters and draws the Rectangle based on the object’s current values. The other takes two values, width and length, and draws a rectangle using those ...