[問題] 計程class問題
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
11/11 22:36, 1F
推
11/11 22:50, , 2F
11/11 22:50, 2F
推
11/12 00:47, , 3F
11/12 00:47, 3F
討論串 (同標題文章)