Explore a diverse range of topics and get expert answers on IDNLearn.com. Our Q&A platform offers reliable and thorough answers to help you make informed decisions quickly and easily.

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.


Sagot :

Answer:

The prototype is as follows:

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

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]);