Chapter 7. Creating and Using Functions

<feature>
  • Learn about various types of functions

  • Understand function return types and values

  • Find out how to create your own functions

  • Discover how to use command-line arguments

  • Find out how to use variable-argument lists

  • See how to make functions reusable with modules

</feature>

Why Use Functions?

Functions are extremely important in C++, and any real C++ program will have at least one custom function designed to perform some of the program’s work. By creating your own functions, you open the door to an endless world of possibilities. In this chapter, you’ll see how to conceptualize and write your own functions. You’ll also see how to pass data to the functions, process this data, and return a useful result to ...

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.