- I'm not looking for someone to write the code, but if there is anyone online and willing to help walk me through this via facebook messenger or phone I would be eternally grateful. I have a lot of things to do for my last final in physics and would like to get some studying done for that.
ifstream theFile (hotelList);
You're trying to use a variable named hotelList.
To use variables, they have to exist. They need to be created.
See this line: string Floor;
This line creates a variable named Floor. After the variable has been created, you can use it. The variable hotelList was never created. You have to create variables before you can use them. C++ provides some variables for you (like cout) but you're going to have to create hotelListbefore you try to use it.
Or is hotelList meant to be the name of a file? What's the file's name?
I figured out the issue, I needed to use parentheses. However, Now I need to be able to over write that text file and have been looking every where and can not find anything helpful to get me there...I've seen a lot about arrays, but I dont believe that will work...How do I specify which line will be edited??
Basically I needed to be able to ready out my .txt file; from the firt menu option I need to be able to add someone and edit the txt file with out losing the rest of the data.
2) I needed to be able to check someone out.
3) show the occupancy as a grid
4) search for customer by name.
5) exit program..
I need to be able to add someone and edit the txt file with out losing the rest of the data.
Put simply, not going to happen. You have to rewrite the entire file with the new data in.
Put more complicated, you can write over pieces of an existing file but you have to make everything you write over it fit exactly, which seems unlikely. You can also append to the end of an existing file.
Ok I have revised my program and using a void function. I'm getting an error and I'm not sure what it means exactly I've posted the code below any help would be appreciated.
Line 67: You're not calling fillRoom correctly. You're try to pass a specific element (which happens to be out of bounds) of hotelList as an argument. Simply call it passing only the name of the array.