Chapter 7
A1: | The three steps are defining the function, providing a prototype, and calling the function. |
A2: | [click here]
|
A3: | void set_array(int arr[], int size, int value) { for (int i = 0; i < size; i++) arr[i] = value; } |
A4: | double biggest (const double foot[], int size) { double max; if (size < 1) { cout << "Invalid array size of " << size << "\n"; cout << "Returning a value of 0\n"; return 0; } else // not necessary because return terminates program { max = foot[0]; for (int i = 1; i < size; i++) if (foot[i] ... |
Get The Waite Group's C++ Primer Plus, Third 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.