weixin_39151026 2017-06-19 15:47 采纳率: 0%
浏览 855

编程出bug了怎么改啊要,好急啊,大神们帮帮忙吧

using namespace std;
const int MAX=50;
int count=0;
class Student
{
public:
void Set();
void Add();
friend void Read(string number[],string name[],string sex[],string age[],string nation[],string birthplace[],string birthday[],string facult[],string major[],string grade[]);
int Judge(string num);
int Determine(string nam);
void Delete();
void Change();
void Search();
void Display();
.........
int Student::Determine(string nam){
string number[MAX],name[MAX],sex[MAX],age[MAX],nation[MAX],birthplace[MAX],birthday[MAX],facult[MAX],major[MAX],grade[MAX];

Read(number,name,sex,age,nation,birthplace,birthday,facult,major,grade);
for(int i=0;i<count;i++)
{
    if(nam=name[i])
    {
        return i;
        break;
    }
}
return -1;

}
[Error] could not convert 'nam.std::basic_string<_CharT, _Traits, _Alloc>::operator=, std::allocator >((*(const std::basic_string*)(& name[i])))' from 'std::basic_string' to 'bool'

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-06-19 16:53
    关注

    你这个哪里是出bug,根本都编译不过去

    if(nam=name[i])
    ->
    if(nam==name[i])

    评论

报告相同问题?

悬赏问题

  • ¥20 usb设备兼容性问题
  • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)