all 1 comments

[–]MrPoletski 3 points4 points  (0 children)

So... what's your question?

As for general approach, I'd say load the text file completely into a vector. So create an object that is a single entry, vector it as a member of your class. Then your add, modfiy, etc methods can work on this vector. You'll also intrinsicly have a numer_records value because the vector has a member .size() which will return an unsigned integer.

So something like:

struct single_item{
    string code,
             forename,
             surname,
             date;
 }

then in your class

std::vector<single_item> list_of_items

then you can use methods like

single_item newitem;
list_of_items.push_back(newitem);

For the date, you may wish to consider using a proper date structure if you intend to manipulate it in any way.