So let me preface this by saying that I am a college student taking c++. My professor has given us the task of designing an "airline reservation" program, (don't get excited, nothing amazing here) using a three dimensional array as the method of tracking plane, row, and seat that is reserved.
My problem comes in the array. I have intialized it by saying
PLANE ROW and SEATS are all const ints, with the # of planes in the fleet, and the # of rows and seats in the planes. (we are going fairly casic 5 seats and 40 rows.)Code:int planebooker [PLANE] [ROWS] [SEATS] = {0};
When someone books the seat, I am trying to use
to set a seat to reserved (x y and z are just an example this was taken from a set of for loops).Code:planebooker [x][y][z] = 1;
My problem is, not matter what I do, whether i run a trio of for loops to set every seat on the plane to reserved (1), or if I let the customer pick what seat they want I can't get the spot in the array to display a 1.
Anyone have any obvious things that I am missing? I have double checked to make sure that any and all ='s are set to == when comparing, past that, I am not sure what's up. If you want, I can post the entire code, but it's rather long.



LinkBack URL
About LinkBacks


