error C2248
C++错误
1、错误描述
[cpp]
error C2248: “std::basic_ios<_Elem,_Traits>::basic_ios”: 无法访问 private 成员(在“std::basic_ios<_Elem,_Traits>”类中声明)
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
2、错误原因 www.zzzyk.com
代码中通过传值方式传递iostream对象,而非引用的方式。将传递改为引用传递即可。
3、错误常见出现情况
1)>>和<<操作符重载
friend istream& operator>>(istream& is,Type& c);
friend ostream& operator<<(ostream& os,const Type& c);
2)将iostream对象当做成员变量
[cpp]
class CDxfFile
{
protected:
std::istream& m_is; //istream used for reading
}
补充:软件开发 , C++ ,