Vidyalelo
C++ Programming · all questions

File Handling in C++
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

56

Questions

3/3

Page

Pick an option on a question to see the right answer and solution.

Which function is used to read a line from a file in C++?

Select an option to see the answer and solution.

By default, all the files in C++ are opened in . . . . . . . . mode.

Select an option to see the answer and solution.

Which header file is required to use file I/O operations?

Select an option to see the answer and solution.

Which function is used to reposition the file pointer?

Select an option to see the answer and solution.

Which of the following is not used as a file opening mode?

Select an option to see the answer and solution.

Which of the following is used to create an output stream?

Select an option to see the answer and solution.

What is the use of ios::trunc mode?

Select an option to see the answer and solution.

Which of the following is not used to seek file pointer?

Select an option to see the answer and solution.

Which of the following is the default mode of the opening using the ifstream class?

Select an option to see the answer and solution.

Which of the following is used to create a stream that performs both input and output operations?

Select an option to see the answer and solution.

Which of the following is used to move the file pointer to start of a file?

Select an option to see the answer and solution.

Which of the following statements are correct?
1. It is not possible to combine two or more file opening mode in open() method.
2. It is possible to combine two or more file opening mode in open() method.
3. ios::in and ios::out are input and output file opening mode respectively.

Select an option to see the answer and solution.

What is the return type open() method?

Select an option to see the answer and solution.

Which of the following is the default mode of the opening using the ofstream class?

Select an option to see the answer and solution.

Which function is used in C++ to get the current position of file pointer in a file?

Select an option to see the answer and solution.

Which of the following is the default mode of the opening using the fstream class?

Select an option to see the answer and solution.