Which function is used to open a file in C++?
- openFile()
- create()
- open()
- initiateFile()
The open() function is used in C++ to open a file. It is a member function of the file stream classes (like fstream, ifstream, ofstream). By providing the filename and mode, a user can access or modify the contents of a file.
Loading...
Related Quiz
- When using the logical AND operator, if the left operand is false, the right operand is _______ evaluated.
- How can you prevent an object of a C++ class from being copied?
- In C++, _______ functions cannot be virtual.
- Which of the following is not a type of iterator in C++ STL?
- How does the performance of a switch-case statement compare to if-else if-else chains, especially when dealing with a large number of conditions?