mfc出现这样的错误:error C2678: binary '==' : no operator defined which takes a left-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >' (or there is no
acceptable conversion)
怎么办 急急急!!!
错误指着这里错了:
int flag = 0;
CCarSystem *stu = new CCarSystem;
stu->m_spinpai = m_strpinpai;
string temp;
ifstream in("a.txt");
while(in >> temp) {
if(temp==stu->m_spinpai) {
flag = 1;
MessageBox("该品牌已存在!", "注意");
in.close();
m_strpinpai = "";
UpdateData(false); // 只将学号清空,其余信息保留
return;
}
}
in.close();有==那里
acceptable conversion)
怎么办 急急急!!!
错误指着这里错了:
int flag = 0;
CCarSystem *stu = new CCarSystem;
stu->m_spinpai = m_strpinpai;
string temp;
ifstream in("a.txt");
while(in >> temp) {
if(temp==stu->m_spinpai) {
flag = 1;
MessageBox("该品牌已存在!", "注意");
in.close();
m_strpinpai = "";
UpdateData(false); // 只将学号清空,其余信息保留
return;
}
}
in.close();有==那里
解决方案 »
- 这是个老问题了,UDP关于CString的传输?
- ISAXXMLReader::parse()怎么用?
- 重绘RadioButton碰到的头痛问题。怎么GetCheck,和SetCheck(同组radio中只有一个是checked=TRUE,我目前这样做:。。
- 散个分,都得弄这么长的标题
- PreTranslateMessage函数问题??
- ※XDJM帮我参考一下职业发展方向!!!※——我没分了?!
- 各位高手请进:关于大数库Freelip的问题
- 关于USB通信的问题
- 界面开发高手进来看看
- 什么是“延迟更新”?
- ActiveX 中 html浏览器控件怎么读取Dom
- 【胡乱提问】能否实现C++作为后台逻辑实现,前台界面通过JS实现-。-
void Add::write(CCarSystem *stu)
{
stu->m_spinpai=m_strpinpai;
stu->m_syanse = m_stryanse;
stu->m_sleibie = m_strleibie; ofstream ou;
ou.open("a.txt", ios::app);
ou << left;
ou << setw(20) << stu->m_spinpai;
ou << setw(20) << stu->m_syanse;
ou << setw(20) << stu->m_sleibie;
ou << endl;
ou.close();}
of.open("a.txt", ios::app);
of << left;
of << setw(20) << "stu->m_spinpai";
of << setw(20) << "stu->m_syanse";
of << setw(20) << "stu->m_sleibie";
of << endl;
of.close();//结果: stu->m_spinpai stu->m_syanse stu->m_sleibie
可见 stu 有 问题 !