Chapter 7

1:What are the three steps in using a function?
A1: The three steps are defining the function, providing a prototype, and calling the function.
2:Construct function prototypes that match the following descriptions:
  1. igor() takes no arguments and has no return value.

  2. tofu() takes an int argument and returns a float.

  3. mpg() takes two type double arguments and returns a double.

  4. summation() takes the name of a long array and an array size as values and returns a long value.

  5. doctor() takes a string argument (the string is not to be modified) and returns a double value.

  6. ofcourse() takes a boss structure as an argument and returns nothing.

  7. plot() takes a pointer to a map structure as an argument and returns a string.

A2:
  1. void igor(void); // or void ...

Get C++ Primer Plus, Fourth Edition 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.