Question: Using the constructors and in the File IO in c++ forms. This small project is geared to test your understanding of File IO. File IO
Using the constructors and in the File IO in c++ forms.
This small project is geared to test your understanding of File IO.
File IO
We have been working on a simple address book. The major problem with it at this point is that we lose all of our information when the program ends. It would be nice to store all of this information to a file. That way, the data will always be there for us.
Your mission is to write all of the entries of your address book to a text file. When you write the file you should write one person per line comma separated. For example
Glenn,Stevenson,1313 Mockingbird Lane,951-639-5532 Jane,Smith,30333 South Street,951-555-5325
This way you can use the comma as a delimiter for each field of the record.
In your constructors you should have functionality to load the address book from file and put the contents into your vector. This means you will have to parse out each field for each record. You should also have a save method that will save the entire contents of the vector to the file formatted.
If you are writing this project in C++ you may want to investigate the idea of writing the contents of the address book to file inside a destructor. This is not required here, only something to think about.
In any event, you must have functionality that will write the contents of your address book to file and have a methodology of saving it.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
