So i'm trying to create a program that will read a file "Workers.txt" and read the numbers from it then write 3 additional employee idnumbers, hourly rate, and hours worked to the file. This is what I got so far and I can't seem to get it to work. Any help?
You have to create ofstream object to write into a file.
say ofstream out.(you cannot use same ifstream object "workers" for writing also) and write to the file.
File name can be same but ifstream and ofstream objects name should be different.
To add to/edit an existing file, one way I knew is you can read the input file data and store it some where and write it again to the same file along with the other details.