我有這樣的代碼:C++引用傳遞:錯誤:沒有匹配函數調用
bool Port::add_app_from_wlist(App* a){
stringstream namesurn;
string name, surname;
namesurn << a->get_name();
namesurn >> name >> surname;
return add_application(a->get_id(),name,surname,a->arrived_at_port_by(),a->arrived_by(),a->is_luxury_class());
}
我得到這個錯誤:
air_classes.cpp:153: error: no matching function for call to `Port::add_application(int, std::string&, std::string&, time_t, time_t, bool)'
air_classes.cpp:98: note: candidates are: bool Port::add_application(int, std::string, std::string, std::string, time_t, time_t, bool)
我不明白,在此字符串&來自於錯誤 - 我怎麼能修改它 - 請幫助。
感謝-well--我想我現在必須刪除我的帳戶:慚愧: – 2010-11-27 21:19:56
@user:我記得自己多次犯這樣的錯誤(並且沒有人的幫助無法找到問題所在):-) Two一雙眼睛肯定比一隻眼睛好。 – Vlad 2010-11-27 22:50:50