Sams Teach Yourself C++ in 21 Days

(singke) #1

DAY 10


WEEK 2

Working with Advanced


Functions


On Day 5, “Organizing into Functions,” you learned the fundamentals of work-
ing with functions. Now that you know how pointers and references work, you
can do more with functions.
Today, you will learn


  • How to overload member functions

  • How to overload operators

  • How to write functions to support classes with dynamically allocated
    variables


Overloaded Member Functions ..........................................................................


On Day 5, you learned how to implement function polymorphism, or function
overloading, by writing two or more functions with the same name but with dif-
ferent parameters. Class member functions can be overloaded as well, in much
the same way.
Free download pdf