Which of the following stream classes is suitable for both reading and writing operations?
- ifstream
- ofstream
- fstream
- sstream
The "fstream" class in C++ is suitable for both input and output operations. This means you can use it for both reading from and writing to files. In contrast, "ifstream" is specifically for input (reading) and "ofstream" is for output (writing).
Loading...
Related Quiz
- Imagine you are maintaining a C++ application where memory leaks are a constant issue. Which type of pointer would be the best to use to ensure that dynamically allocated objects are properly deallocated?
- To prevent a class from being inherited, we declare it as _______.
- Which of the following is a correct statement about friend functions in C++?
- Which access specifier in C++ allows a class member to be accessible only within the class and friends of the class?
- You are tasked with designing a lightweight 3D point class to be used in a performance-critical graphics application. The class should store three float values and should allow public access to these without using getters and setters. Which user-defined data type would be best suited for this purpose?