나는 지난 질문을 통해 특정 답변을 찾을 수 없습니다. 광산. 그래서, 나는이 방법으로 오류를 계속 얻는다. 당신의 도움에 정말로 감사 할 것입니다.오류 : '연산자 =='에 일치하지 않음 (피연산자 유형이 '좌석'이고 'std :: string {aka std :: basic_string <char>}')
오류 :
error: no match for 'operator==' (operand types are 'Seat' and 'std::string {aka std::basic_string}')
void SeatsCreateReservation(vector<Seat>& seats) {
string account_ID;
unsigned int seatNum = 0;
Seat seat;
cout << "Enter username: ";
cin >> account_ID;
for (seatNum = 0; seatNum < seats.size(); seatNum++) {
if (seats.at(seatNum) == account_ID) {
cout << "Seat number too large." << endl;
break;
}
}
seat.Reserve(account_ID);
seats.at(seatNum) = seat;
cout << "Completed." << endl;
return;
}
부분 오류 메시지가 확실하지 않습니까? 'seats.at (seatNum) == account_ID'는 한편으로는 'Seat'인스턴스와 다른 한편으로는'std :: string' 인스턴스를 비교하려고 시도하지만이 비교를 수행 할 수단을 구현하지 않았습니다. –