[問題] 計程class問題

看板NTUEE110HW作者 (吐司)時間19年前 (2006/11/11 21:56), 編輯推噓3(300)
留言3則, 3人參與, 最新討論串1/2 (看更多)
employee worker1("Paul","Lin",30000); //parameter是constructor要求輸入的 //現在想測試一下initial的資料 cout<<"The employee "<<worker1.getfirstname()<<" " <<worker1.getlastname()<<"\'s monthly salary is " <<worker1.getmonsalary()<<endl; 結果compile的時候他告訴我這邊錯了(cout那行) 以下是錯誤訊息 no match for 'operator<<' in 'std::operator<< [with _Traits = std::char_traits<char>] (((std::basic_ostream<char, std::char_traits<char> >&)(&std::cout)), ((const char*)"The employee ")) << (&worker1)->employee::getfirstname()' 看不懂- -a 有高手能幫忙解惑嗎 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.240.124 ※ 編輯: jackwei 來自: 140.112.240.124 (11/11 22:03) ※ 編輯: jackwei 來自: 140.112.240.124 (11/11 22:05)

11/11 22:36, , 1F
應該是char的問題 可以PO原class的定義嗎?
11/11 22:36, 1F

11/11 22:50, , 2F
ni\\你怎麼寫得這麼難啊??
11/11 22:50, 2F

11/12 00:47, , 3F
好高深的感覺...我完全沒有用到class的功能說...
11/12 00:47, 3F
文章代碼(AID): #15LTQT8E (NTUEE110HW)
討論串 (同標題文章)
文章代碼(AID): #15LTQT8E (NTUEE110HW)