Question: ifstream file; file.open ( myfile . txt ) ; What will happen when the lines of code above are executed and myfile.txt

ifstream file;
file.open("myfile.txt");
What will happen when the lines of code above are executed and "myfile.txt" exists in program's working directory?
The program will exit with an error message
The file will opened and will be ready for use
The file will be deleted and a new one created
The data in the file will be overwritten with whatever new data the program generates
ifstream file; file.open ( " myfile . txt " ) ;

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 Programming Questions!