Question: RecordSet Module Design and code a class named RecordSet that manages a dynamically allocated array of std::strings. Your class keeps track of the number of
RecordSet Module
Design and code a class named RecordSet that manages a dynamically allocated array of std::strings. Your class keeps track of the number of strings currently stored and defines the following member functions:
- a no-argument default constructor
- a 1-argument constructor that receives the address of a C-style null terminated string containing the name of a file from which this member function populates the current object. This function
- reads the file to count the number of records present (the record delimiter should be a single space ' ')
- allocates memory for that number records in the array
- re-reads the file and loads the records into the array.
- a copy constructor
- a copy assignment operator
- a destructor
- size_t size(): a query that returns the number of records stored in the current object.
- std::string getRecord(size_t): a query that returns the record at the index received as parameter. If the index is invalid, this function should return the empty string.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
