Looking for trustworthy answers? Westonci.ca is the ultimate Q&A platform where experts share their knowledge on various topics. Explore in-depth answers to your questions from a knowledgeable community of experts across different fields. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform.

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