Hi guys nid some helps over here.
Well,i hav a question requiring me to edit sales achieved by an employee for a particular month.
I'm having a dat.file which following format
Sales(for a year)
10.00 20.00 30.00 40.00 50.00 60.00 70.00 80.00 90.00 100.00 110.00 120.00
Wad I wanna is TO EDIT only the sales for July which is 70.00 to a new amount with other months remain intact.
I need to search particular id which will then link to their respective sales.
cout<<"Please Enter Employee ID:\n";
cout<<"Kindly input the month you wish to edit:\n";
cout<<"1)January 2)February 3)March 4)April\n";
cout<<"5)May 6)June 7)July 8)August\n";
cout<<"9)September 10)October 11)November 12)December\n";
I tried to run myself before.But I could only create a new line instead of replacing.
To my understanding with ios::app ..will use the same file for editting..
Last edited on
with ios::app you will append lines to the file opened without touching anything already written.
However, with your code, if you remove ios::app you would delete the content of the file EXCEPT what you are modifying (if other employes present in your .dat, they will deleted).
You must find a way how to modify your line without deleting the other parts of the file...
But removing ios::app
Wont it create a new file?
another side question;
any ideas on how to convert every first letter to capital if small letters were entered?
i mean when it outFile it.
i shall see the new format in my dat.file.