0

The code below takes the quantity of tickets from the 55 tickets that is available and it stores the value in a text file. What I want the program to do is to store the amount of tickets that is available and then each time the program executes it will take away from the remaining tickets that is available. Thanks

AmountOfTickets = 55; 

 NewAmountOfTickets = AmountOfTickets - AdditonalAdultQty - AdditonalChildQty - AdditonalSeniorQty - AdditonalFamilyQty - AdultQty - ChildQty - SeniorQty - FamilyQty;   
     
         ofstream myfile1;
 
         myfile1.open ("Tickets Left.txt");
 
         myfile1 << NewAmountOfTickets;
 
         myfile1.close();
        
         NewAmountOfTickets1 = NewAmountOfTickets - AmountOfTickets - AdditonalAdultQty - AdditonalChildQty - AdditonalSeniorQty - AdditonalFamilyQty - AdultQty - ChildQty - SeniorQty - FamilyQty;
        
         ifstream inFile("Tickets Left.txt");
 
         inFile>> NewAmountOfTickets;
 
         inFile.close();

Edited by KRUX17: n/a

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by KRUX17
0

Sounds like you want to delete a value from the file "Tickets Left.txt". To do this, you'll have to make a new file, copy everything across that you want copied across, delete the old one and then name the new one with the same name.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.