File in C++ - Quizizz
File in C++ - Quizizz
File in C++
Class
Total questions: 25
Worksheet time: 7mins
Date
Instructor name: Rajalakshmi M
Multiple Choice
c) Text
Multiple Choice
2. It is not possible to combine two or more file opening mode in open() method
a) True b) False
Multiple Choice
a) ios::nocreate b) ios::ate
c) ios::truncate d) ios::noreplace
Multiple Choice
a) True b) False
Multiple Choice
5. If we have object from of stream class then default mode of opening the file is__________
a) ios::in b) ios::out\ios::trunk
c) ios::out d) ios::in\ios::trunc
Multiple Choice
a) float b) char*
c) bool d) int
Multiple Choice
7. If we have object from fstream class, then what is default mode of opening the file
a) ios::in\ios::trunc b) ios::in\ios::out
Multiple Choice
c) iostream d) ifstream
Multiple Choice
9. Streams that will be performing both input and output operation must be declared as class
a) f stream b) stdiostream
c) stdtream d) iostream
Multiple Choice
a) ios::end b) los::begl
c) ios::set d) ios::cur
Multiple Choice
a) if the file is opened for output operation and it b) if the file is opened for output operation and it
already existed its previous content in deleted already existed then a new copy is created
and replaced by new one
Multiple Choice
a) My::open b) Myfile:open
c) Myfile.open
Multiple Choice
14. Calling the stream member function sync() causes the immediate synchronization
a) False b) True
Multiple Choice
Multiple Choice
16. Which among is used for positioning relative to the beginnig of a stream
a) ios::start b) ios::beg
c) ios::beginning d) ios::begin
Multiple Choice
a) changep() b) seekg()
c) go_p() d) moveg()
Multiple Choice
18. which function is used in c++ to get the current position of file pointer in a file
a) get_pos() b) tell_p()
c) get_p() d) tell_pos()
Multiple Choice
a) returns true if a file open for reading has b) returns true if a file open for reading has
reached the next character reached the end
Multiple Choice
a) streambuf b) memory
Ans.
Fill in the Blank
Ans.
Multiple Choice
a) 3 b) 1
c) 4 d) 2
Multiple Choice
24. pick out the correct object about the instantiation of output stream
c) cout d) clog
Ans.
Answer Keys
10. a) <f stream> 11. c) ios::set 12. a) if the file is opened for
output operation and it
already existed its
previous content in
deleted and replaced by
new one
19. b) returns true if a file open 20. a) streambuf 21. writes to a file, file
for reading has reached
the end