Question: Consider the code snippet below: ifstream myFile; myFile.open(input.txt); if(!myFile){ //First Block } else { //Second Block } If you were to compile and run
Consider the code snippet below: ifstream myFile; myFile.open("input.txt"); if(!myFile){ //First Block } else { //Second Block } If you were to compile and run this code and find that "First Block" executes, what is one possible explanation? was not included in the program. input.txt does not exist. input.txt is too large for the compiler to open. A filestream cannot be in a condition because it is not an integer.
Step by Step Solution
There are 3 Steps involved in it
Answer is there is no such file like inputtxt Below i have written and c... View full answer
Get step-by-step solutions from verified subject matter experts
