Computer Science, asked by princechethan, 10 months ago

how to handle errors during file I/O poration​

Answers

Answered by Mehakjannat01
1

Answer: how to handle errors during file I/O poration​

Explanation:

Sometimes during file operations, errors may also creep in. For example, a file being opened for reading might not exist. Or a file name used for a new file may already exist. Or an attempt could be made to read past the end-of-file. Or such as invalid operation may be performed. There might not be enough space in the disk for storing data.

To check for such errors and to ensure smooth processing, C++ file streams inherit 'stream-state' members from the ios class that store the information on the status of a file that is being currently used. The current state of the I/O system is held in an integer, in which the following flags are encoded.

Similar questions