Looking for reliable answers? Westonci.ca is the ultimate Q&A platform where experts share their knowledge on various topics. Join our platform to connect with experts ready to provide precise answers to your questions in various areas. Connect with a community of professionals ready to provide precise solutions to your questions quickly and accurately.

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