13) An output file stream object (ofstream) receives data and formatters using the stream insertion operator << in exactly the same way that the cout object does. True or False
14) The result of a read operation on an input file stream (ifstream) object is a boolean value indicating if the read succeeded or failed. True or False
15) A file stream object must be closed by the program after all the necessary reads or writes are completed. True or False
(i) True
Explanation:- cout is an object of class ostream which uses << . Similarly output file stream object of class ofstream receives data using stream insertion operator << in the same way.
(ii) True
we can test whether read is successful or not manually by putting object in if condition.
if (obj)
std::cout << " read is successfully done.";
else
std::cout << "error is found ";
is.close();
(iii) True.
It is very important to free out the memory taken by object and to do so we use closing of file stream object by close() function .
DON'T FORGET TO HIT LIKE.
THANKS BY HEART.
Get Answers For Free
Most questions answered within 1 hours.