Question
Each of the following definitions and program segments has errors. Locate as many as you can.void showValues(int nums[4][]){for (rows = 0; rows < 4; rows++)for (cols = 0; cols < 5; cols++)cout << nums[rows][cols];}
Step 1
The function `showValues` is defined to take a parameter `nums` as `int nums[4][]`. This is incorrect because in C++, when declaring a 2D array, the size of the second dimension must be specified. The correct declaration should be `int nums[][5]` or `int Show more…
Show all steps
Your feedback will help us improve your experience
Watch the video solution with this free unlock.
EMAIL
PASSWORD