Chapter 6. Overloading Functions and Operators

C++ has many features that make life easier for programmers. For example, thinking up unique and meaningful names for functions can be irksome. You saw in Chapter 4, “Programs and Libraries,” how namespaces can keep families of functions together, but even with namespaces, you still need to come up with names such as print_date() and print_person(). With the C++ feature function overloading, you can let one name stand for a number of functions, depending on the arguments. In C++ you can also redefine operators, so you can define a simple notation for common operations on structures. Functions can call themselves, under special conditions, and they can be passed as parameters to other functions.

In this chapter you will learn about

  • Overloading functions and using default parameters

  • Redefining C++ operators, especially for output and input

  • Recursive algorithms

  • Using Turtle Graphics

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.122.244