Ask Question

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");

+4
Answers (1)
  1. 28 May, 07:32
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers