69.4k views
0 votes
Checkpoint 7.61 Write the prototype for a function named showSeatingChart that will accept the following two-dimensional array as an argument. const int ROWS = 20; const int COLS = 40; string seatingChart[ROWS][COLS]; Note: The two-dimensional array argument must be a const string array. You must include a second integer argument (scalar, not an array).

User Minchaej
by
3.7k points

1 Answer

4 votes

Answer:

void showSeatingChart(const string [][COLS], int);

Step-by-step explanation:

void showSeatingChart(const string [][COLS], int);

The above function showSeatingChart() will display the 2D array of seating chart.

The return type of this function is void because it does not need to retun anything.

The parameter of the function is a 2D array which is seatingChart[ROWS][COLS].

The type of this 2D array is string that means it is a 2D array of string. It will contain string elements.

To declare a prototype of a function, there should be a semi-colon (;) at the end of declaration.

The definition of the function should be given outside main() function and declaration of the function should be above the main() function or at the beginning of the program with declaration of constant variables.

User Nick Sinas
by
4.6k points