开发者

Problem with ifstream::setbuf in VS2008

开发者 https://www.devze.com 2023-01-09 10:27 出处:网络
What changes are needed when porting \"setbuf\" in VS2005 to VS2008? I have to modify a project in VS2005 to VS2008 to be able to build it. Below is the line of code that needs to be compiled in VS20

What changes are needed when porting "setbuf" in VS2005 to VS2008?

I have to modify a project in VS2005 to VS2008 to be able to build it. Below is the line of code that needs to be compiled in VS20开发者_Go百科08.

 std::ifstream In; 
 In.setbuf(FileBuffer, BUFFER_REGION_SIZE); 

When I compile the above code in VS2008, I see the below error.

 error C2039: 'setbuf' : is not a member of 'std::basic_ifstream<_Elem,_Traits>' 

What needs to be done to compile it in VS2008?


Did you try something like In.rdbuf()->pubsetbuf(FileBuffer, BUFFER_REGION_SIZE);?

See http://www.cplusplus.com/reference/iostream/streambuf/pubsetbuf/

0

精彩评论

暂无评论...
验证码 换一张
取 消