Design and code a class named RecordSet that manages a dynamically allocated array of std::strings. Your class
Fantastic news! We've Found the answer you've been seeking!
Question:
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.
Related Book For
Fundamental Statistics for the Behavioral Sciences
ISBN: 978-1285076911
8th Edition
Authors: David C. Howell
Posted Date: