--:--









Quiz for File streams ifstream

Course: C++ Language | Subject: Unit 12 | Topic: File Handling



Logo

Q1: Which class is used for reading from files in C++?

Logo

Q2: Which header file must be included to use ifstream?

Logo

Q3: How do you open a file named "data.txt" for reading using ifstream?

Logo

Q4: How to check if a file was successfully opened using ifstream?

Logo

Q5: Which function reads a line of text from a file into a string?

Logo

Q6: What happens if you try to open a non-existent file with ifstream?

Logo

Q7: How to close an ifstream object?

Logo

Q8: Which mode does ifstream open the file by default?

Logo

Q9: Which operator can be used to read formatted data from ifstream?

Logo

Q10: What does eof() function indicate?

Logo

Q11: How to check if the last read operation failed?

Logo

Q12: Which function can be used to ignore characters in a stream?

Logo

Q13: Which method returns the current position of the get pointer?

Logo

Q14: Which function moves the get pointer to a specified location?

Logo

Q15: What is the default open mode for ifstream?

Logo

Q16: Can ifstream be used to write to files?

Logo

Q17: Which of these is NOT a member function of ifstream?

Logo

Q18: How to check if a file stream is in a good state?

Logo

Q19: What is the typical use case of ifstream?

Are you ready to start test? Set your time limit