C++ 文件输入输出流问题

C++语言 码拜 7年前 (2017-04-30) 1516次浏览
 char ch[10];
    strcpy(ch,"C:\Users\john\Desktop\haha.txt");
    ifstream f(ch,ios :: binary | ios :: in,filebuf :: sh_read);
 strcpy(ch,"C:\Users\john\Desktop\haha.txt");
    ofstream os(ch,ios :: binary | ios :: out,filebuf :: sh_write);

这样的错误怎么办?
error: “sh_read” is not a member of “std::filebuf {aka std::basic_filebuf<char>}”
error: “sh_write” is not a member of “std::filebuf {aka std::basic_filebuf<char>}”

解决方案

10

5

sh_write 哪里来的东西?

10


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明C++ 文件输入输出流问题
喜欢 (0)
[1034331897@qq.com]
分享 (0)