Ask Question
25 March, 01:05

Suppose that outFileis an ofstreamvariable and output is to be stored in the file outputData. out. Which of the following statements opens the file outputData. outand associates outFileto the output file?

a. outFile ("outputData. out");

b. outFile. open ("outputData. out");

c. open (outFile,"outputData. out");

d. open. outFile ("outputData. out");

+2
Answers (1)
  1. 25 March, 04:46
    0
    Option b outFile. open ("outputData. out");

    Explanation:

    In C++, there are several classes given to handle output and input of characters to or from files. They are:

    ofstream that write on files ifstream that read from files

    We can use an object of ofstream to hold the contents that we wish to output to an external file. The general syntax is as follows:

    ofstream_obj. open (file_name)

    This will create a file with a specific file name and it possesses all the contents from the obstream_obj.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Suppose that outFileis an ofstreamvariable and output is to be stored in the file outputData. out. Which of the following statements opens ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers