Ask Question
24 May, 14:10

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

+1
Answers (1)
  1. 24 May, 15: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?
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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers