Question: The following code generates an error. Why? #include #include using namespace std; int main ( ) { ofstreamoutFS; if ( ! outFS.is _ open (
The following code generates an error. Why?
#include
#include
using namespace std;
int main
ofstreamoutFS;
if outFS.isopen
cout "Could not open file myfile.txt endl;
return ;
outFS "Hello" endl;
outFS endl;
outFS.close;
return ;
Group of answer choices
Data cannot be directly fed into ofstream using outFS
outFS.close; is not used correctly
The file 'myfile.txt has not been opened
The code is missing a header
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
