Ok here I am again looking for some help. I'm at a loss and do not know why this console program is not working. Here is what it is SUPPOSED to do:
Allow the user to choose which section they would like to sit in.
Allow the user to choose which row and column they would like to sit.
Display a chart (array) showing which seat they have chosen then return to the main menu.
The array is supposed to be 13 rows designated by integers 1-13 (each section has particular rows) and 6 columns designated by characters A-F.
Here is the problem:
It will not allow the program to run because it says "error: 'void seating(char)' cannot convert argument 1 from 'char[13][6]' to char"
Please bypass me using usingnamespace std;
Here is my code:
Thats because you are trying to pass a double dimension array of char to a function that accepts a single char.
Culprit is line 11. The forward declaration does not match the actual function on line 62
Ok. I figured that part out. Had to change the declaration to void seating(char chart[][6]); that actually makes the program run. Different issue. If I choose case 4 at the very beginning, the program freezes up, but if I make a seat selection then it will show the seating chart. Don't understand that. Secondly, the economy class looks exactly the same as the other two, but runs differently. The first two will run as follows:
Which Row?
// wait for user response
Which Column?
// wait for user response
The economy class runs as follows?
Which Row?
Which Column?
// wait for user response
I do not see what is different in the code to make it do this.
Ah so it was not the same as the other two. Oops. Where would I initialize column though? I thought I was initializing it in main, but I'm not sure what value I should give it. The seating function initializes the '*' in all the proper places to start the chart out as if all seats are available. Then it runs through and shows the chart as if all seats are available after the user makes a seat selection.
Then it runs through and shows the chart as if all seats are available after the user makes a seat selection.
Disregard that. I'm a little slow. That portion works. Just do not know where to initialize the column. After that is fixed, then the program will run properly. I have class today in about half an hour so if I do not fix it by then, I'll run it by my instructor to see what he says.
Ok. This is what I did instead. I'm not even giving the option of looking at the seating chart before making a selection. Instead, I'm calling the show_seating function in each case, so after making a selection, it will show the chart of available seating with the users seat showing as reserved. Thanks again wildblue for pointing me in the right direction!