Question: Problem 4 (15 points) Consider the following C++ class: class myFile { public: myFileconst char *fname); MyFile(): void print(); }; An object of this class
Problem 4 (15 points) Consider the following C++ class: class myFile { public: myFileconst char *fname); MyFile(): void print(); }; An object of this class opens a file and keeps it open, method print() prints that file's content to cout, while the constructor closes the file. Provide a complete implementation for this class. Feel free to add data members as you see fit. The constructor must throw an exception if the file cannot be open for reading. Your function main() must provide proper exception handling
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
