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?
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.
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?
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.