Font size
WorksheetsFile in C++
Total questions: 25
Worksheet time: 7mins
By default all the files are opened in_____mode
Binary
Text
can't say
It is not possible to combine two or more file opening mode in open() method
True
False
Which of the following is not a file opening mode
ios::ate
ios::nocreate
ios::noreplace
ios::truncate
Due to ios::trunc mode the file is truncated to zero length
False
True
If we have object from of stream class then default mode of opening the file is__________
ios::in
ios::out
ios::in\ios::trunc
ios::out\ios::trunk
_______is return tyoe of is_open() function
int
bool
float
char*
If we have object from fstream class, then what is default mode of opening the file
ios::in\ios::out
ios::in\ios::trunc
default mode depends on compiler
To create an output stream we must declare the stream to be of class
ofstream
ifstream
iostream
none of these
Streams that will be performing both input and output operation must be declared as class
iostream
f stream
stdtream
stdiostream
To perform file I/O operations,we must use ________header file
<if stream>
<of stream>
<f stream>
none of these
Which of the following is not used to seek a file pointer
ios::cur
ios::set
ios::end
los::begl
ios::trunc is used for
if the file is opened for output operation and it already existed its previous content in deleted and replaced by new one
if the file is opened for output operation and it already existed then a new copy is created
Which is correct syntax
Myfile:open
Myfile.open
My::open
Calling the stream member function sync() causes the immediate synchronization
True
False
eof() is used to get
easy code reivew
end of file
debug report
file close
Which among is used for positioning relative to the beginnig of a stream
ios::start
ios::beg
ios::begin
ios::beginning
Which function is used to reposition the file pointer
moveg()
seekg()
changep()
go_p()
which function is used in c++ to get the current position of file pointer in a file
tell_p()
get_pos()
get_p()
tell_pos()
What is use of eof()
returns true if a file open for reading has reached the next character
returns true if a file open for reading has reached the next word
returns true if a file open for reading has reached the end
what must be specified when we construct an object of class ostream
stream
streambuf
memory
none of the mentioned
what is meant by ofstream in c++
(a)
what can be used to input a string with blankspace
(a)
how many group of output of operation are there in C++
1
2
3
4
pick out the correct object about the instantiation of output stream
cout
cerr
clog
all of the mentioned
in order to open a file with a stream object we use its (a) function
