86.9k views
2 votes
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];
The assignment is due today at 10:00 pm.

User Perimosh
by
5.0k points

1 Answer

3 votes

Answer:

The prototype is as follows:

void showSeatingChart (string seatingChart[][40]);

Step-by-step explanation:

Required

The prototype of a function that accepts a 2D array

The syntax to do this (in C++) is as follows:

return-type function-name(array-type array-name[][Column])

  1. The return type is not stated, so I will make use of void
  2. From the question, the function name is showSeatingChart
  3. The array type is string
  4. The array name is seatingChart
  5. Lastly, the number of column is 40

Hence, the function prototype is:

void showSeatingChart (string seatingChart[][40]);

User Jacob Curtis
by
5.2k points