Question: I need help fixing my code, I am trying to use pointers to access arrays. The program is making reservations to a theater with 3

I need help fixing my code, I am trying to use pointers to access arrays. The program is making reservations to a theater with 3 different sections. Each section has 10 rows and 20 columns. You can view mapping of the seats, reserve a seat if it's not taken, and remove the seat if you don't want it reserved anymore. Also when you reserve, you have to store the name of the person reserving it. I need help fixing my code, I am trying to use pointers

#include #include #include using namespace std; //display map. initialize to nullptrs //reserve //list reserved seats //quit

//Error check section + row; int ROWS = 10; int COLS = 20; int displaySeat(char seatingChart[][20], int rows); int chooseSeat (char* seatingChart[][20], int rows, int& chosenRow, int& chosenCol); int alreadyTaken (char* seatingChart[][20],int rows); void showMenu(); int giveUpSeat (char* seatingChart[][20],int rows); int errorMessage ();

int main() { int option; cin >> option; showMenu(); cout > sectionLetter; if (sectionLetter = 'a') {chooseSeat(&sectionA); }else if(sectionLetter = 'b') {chooseSeat(&sectionB); }else if(sectionLetter = 'c') {chooseSeat(&sectionC); }else {errorMessage();} } else if (option == 3){ cout

} }

/* Reserving a seat, type in Section, Row, and column. If row && seat && section choice is taken, cout it is taken conditions : seating is = nullptr || = available; else it is taken. */ int chooseSeat (char* seatingChart[][20], int rows, int& chosenRow, int& chosenCol){

for (int i=0; i> chosenRow; //col # cout > choseCol; cout

void showMenu (){ cout

int errorMessage (){ if (option != 1 && option != 2 && option != 3 && option != 4 && sectionLetter!='a' && sectionLetter!='b' && sectionLetter !='c'){ cout

error: #error This file requires compiler and library support for the ISO C warning: In function 'int main)': 75 identifier 'nullptr' is a keyword in C++11 -Wc++0x-compat] 31 error: cannot convert 'char () [10] [20]'to 'char () [20' for argument '1'.. . 31 error: cannot convert 'char () [10] [20]'to 'char () [20' for argument '1'.. . 31 error: cannot convert 'char () [10] [20]'to 'char () [20' for argument '1'.. . 31 error expected primary-expression beforetoken 36 warning: suggest parentheses around assignment used as truth value -Rparen.. . 36 error: cannot convert 'char () [10] [20]'to 'char () [20]' for argument '1... 37 warning: suggest parentheses around assignment used as truth value -Rparen.. . 37 error: cannot convert 'char () [10] [20]'to 'char () [20]' for argument '1... 38 warning: suggest parentheses around assignment used as truth value -Rparen.. . 38 error: cannot convert 'char () [10] [20]'to 'char () [20]' for argument '1... 42error: cannot convert 'char () [10] [20]'to 'char () [20]' for argument '1... 43error: cannot convert 'char () [10] [20]'to 'char () [20]' for argument '1... 44error: cannot convert 'char () [10] [20]'to 'char () [20]' for argument '1... In function 'int displaySeat (char (*) [20])': 54 error: uninitialized const 'seats' [-fpermissive] 58 71 error a function-definition is not allowed here before ' token 54 warning: unused variable 'seats' [-unused-variable] 129 error expected'' at end of input 129 warning: no return statement in function returning non-void [-Wreturn-type errorrows' was not declared in this scope error: #error This file requires compiler and library support for the ISO C warning: In function 'int main)': 75 identifier 'nullptr' is a keyword in C++11 -Wc++0x-compat] 31 error: cannot convert 'char () [10] [20]'to 'char () [20' for argument '1'.. . 31 error: cannot convert 'char () [10] [20]'to 'char () [20' for argument '1'.. . 31 error: cannot convert 'char () [10] [20]'to 'char () [20' for argument '1'.. . 31 error expected primary-expression beforetoken 36 warning: suggest parentheses around assignment used as truth value -Rparen.. . 36 error: cannot convert 'char () [10] [20]'to 'char () [20]' for argument '1... 37 warning: suggest parentheses around assignment used as truth value -Rparen.. . 37 error: cannot convert 'char () [10] [20]'to 'char () [20]' for argument '1... 38 warning: suggest parentheses around assignment used as truth value -Rparen.. . 38 error: cannot convert 'char () [10] [20]'to 'char () [20]' for argument '1... 42error: cannot convert 'char () [10] [20]'to 'char () [20]' for argument '1... 43error: cannot convert 'char () [10] [20]'to 'char () [20]' for argument '1... 44error: cannot convert 'char () [10] [20]'to 'char () [20]' for argument '1... In function 'int displaySeat (char (*) [20])': 54 error: uninitialized const 'seats' [-fpermissive] 58 71 error a function-definition is not allowed here before ' token 54 warning: unused variable 'seats' [-unused-variable] 129 error expected'' at end of input 129 warning: no return statement in function returning non-void [-Wreturn-type errorrows' was not declared in this scope

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!