Chapter 8. Overloading Functions

<feature>
  • See how function overloading works

  • Understand why the compiler mangles function names

  • Learn about function calls and antonyms from the thesaurus

  • See how to change the numbers and types of function parameters

</feature>

Why Use Function Overloading?

In Chapter 7, “Creating and Using Functions,” you saw how functions can make your life much easier by allowing you to break complex programming tasks into bite-size chunks. Using functions reduces the amount of code you have to write and maintain because you can create a single function definition and use it in multiple places. In a language like C, when you have several functions that perform similar tasks but work with different data types, each of the functions ...

Get Practical C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.