Which header file is required for file handling in C++?
Correct!
Wrong!
The header provides facilities for file input and output in C++.
Which stream is used to write to a file?
Correct!
Wrong!
The ofstream class is used to create files and write information to them.
Which STL container stores key-value pairs?
Correct!
Wrong!
The map container in STL stores elements in key-value pairs, with unique keys.
Which operation checks if a file stream opened successfully?
Correct!
Wrong!
The is_open() method checks if a file was successfully opened.
Which STL container allows access in constant time using indices?
Correct!
Wrong!
The vector container allows random access in constant time.
Which function is used to read data from a file line by line?
Correct!
Wrong!
The getline() function is commonly used to read a file line by line.
Loading Questions...
Which STL algorithm is used to sort elements?
Correct!
Wrong!
The sort() function from is used to sort elements in a range.
What is required to use STL containers like vector or map?
Correct!
Wrong!
STL containers are included through standard header files like ,
Which stream is used to read from a file?
Correct!
Wrong!
ifstream is used to read data from files in C++.