Which of the following statements opens the file info.txt for both input and output? a) dataFile.open("info.txt", ios::in && amp; ios::out); b) dataFile.open("info.txt", ios::in , ios::out); c) dataFile.open("info.txt", input || output); d) dataFile.open("info.txt", ios::in | ios::out);
2 answers:
Answer:
D
Explanation: Choice D
Answer:
Correct answer is D
Explanation:
open is a function in c++ programming language used to interact with files.The function takes two parameters as input
File name mode File Name
File name is a string name of file to be opened.This is a compulsory parameter for open method.
Mode
Mode is an optional parameter in open function.Following are the accepted values of mode parameter
Prefix ios:: is added to start of each
in (Open file in input mode for writing data to file) out (Open file in output / read-only mode to read data from file) binary (Open file in binary format) ate (Set the starting point of file to the end of file. Default starting point of file is start of file) "trunc" (If file is opened multiple times all previous data is replaced with new data) app (All operations of output are performed the end of file) Use | operator to use multiple modes at a time.
You might be interested in
Is it apprenticeship???:D
The answer is D. Electoral College
The 7 components found in a computer tower are the following: Power supply unit Central processing unit Hard disk drive Ram modules Motherboard Video card Sound card
Answer:
Information is the act of imparting knowledge and data is the recorded observation that are usually presented in a structured format