how to fix migratation error in vs2019

Lakshay Goel 10 Reputation points
2023-02-16T18:28:12.3+00:00

Hi team ,

i am trying to fix a migratation error

" Error C2039 '_ptr': is not a member of '_iobuf'"

error comes while migrartion of the code ,please help me out in this

Developer technologies | C++
Developer technologies | Visual Studio | Other
{count} vote

1 answer

Sort by: Most helpful
  1. Minxin Yu 13,506 Reputation points Microsoft External Staff
    2023-02-21T09:47:08.9466667+00:00

    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.