Hi, Lakshay Goel
_fileno(iop) can be used in _read.// before ( iop->_file)
nread= _read(_fileno(iop), ptr, to_read);
For _flag:
You can declare a variable int iop_flag
separately or create a custom structure:
You may need to define the values of _IOEOF and IOERR.
struct MyFILE
{
FILE* fp=NULL;
int _flag;
...... other members .......
};
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.