Pointers were examined in the previous chapter and their value will be demonstrated here, as this chapter explores another fundamental concept-functions. Functions in C++ are based on the mathematical concept of functions insofar as they generally accept arguments as input, and generally output results. As we shall see, not all C++ functions accept input and not all give output, though many do. In short, functions can be thought of as machines and as a means of dividing code into logical, manageable blocks. Specifically, this chapter examines the following topics:
Functions in mathematics
Functions in C++
Arguments
Return types
Overloading
Pointers and functions
Recursion