Files into arrays

Pages: 12
closed account (SECMoG1T)
let me add some helper functions.
closed account (SECMoG1T)
hey i have tried clean things up a little ... no luck but i have remove the errors that were there earlier.

hope that helped, if you don't understand some ask.

https://pastebin.com/c5R6YVDn
Oh, Thank you very very very much,
words can not describe how thankful i am.

Also i need to do a delete function, i think the most suitable solution is to make a temp.txt file read everything except the item which is to be deleted then copy it back right? or is there a simpler way?

Thanks a lot again.
closed account (SECMoG1T)
that would be a very expensive operation, as you can see from my modified code on paste bin.

-the data is read into the arrays at the genesis of the program.
-any data added during runtime is stored into the array
-the data is saved into the file when the program is exiting.

so to delete an entry just search that entry, get the index and change everything to default values e.g name ="";///empty string id=0; phone=0; ticket_num=0;
the function i hvae written to save data will just skip any empty entries.

https://pastebin.com/ke5qEDFf


i have added a delete function, please debug any errors you find.
Yup it is working.
Thanks a million.
By the way what does the last function do exactly?
oh i get it now, it skips the empty entries.
THANKS!!.
By the way, if i have 50 tickets sold then if i delete one and then book another it says all the tickets are sold, any idea how to fix that? should i make conditions of count-- at the delete function everytime it deletes a ticket?
closed account (SECMoG1T)
hello i'll be changing a few things, post the final later.
Thank you so much,
i will be waiting.
closed account (SECMoG1T)
i have changed a few things, i have used an array that tracks the sold tickets instead of just storing ticket numbers, everything should work as expected now, i have also added some few function , deleted other and redefined them .

if you have a question ask?

https://pastebin.com/n3xNx2Xv


once you understand classes and struct the whole thing would be very simple.
Thank you very much for your help and patience.
well i think i will spend my vacation learning more about the language outside my course that would probably grant me more freedom, i also struggled a bit since this semester was short and everything happened so quickly.
Thank you very much again.
By the way at line 461 it gives me an error
std::string ticket_type{};
this is an array?
if yes what should be the range
Edit: i think it is just a normal string.
Last edited on
closed account (SECMoG1T)
sorry change it to std::string ticket_type="";
no it is just a string variable.

if you have any other error ask.

edit: updated again, fixed main_menu()

https://pastebin.com/6SwCKcr8
Last edited on
Nope other than that it is error free, thank you very much.
closed account (SECMoG1T)
yea there is an unimplemented function

main menu option " b. Cancel ticket reservation\n"\ isn't implemented, unless it means the same as option h
Last edited on
Yup it is the same as option h.
closed account (SECMoG1T)
all errors fixed.


https://pastebin.com/Xrmc3iAc


remember to set your own file path on line 39
Last edited on
Topic archived. No new replies allowed.
Pages: 12