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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!