[問題] class 的主體已經被宣告了

作者: smartjay (高毛毛)   2016-08-05 17:17:25
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC2015
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
none
問題(Question):
練習定義 員工此class 可以利用Set Get 設定及取得資訊
餵入的資料(Input):
Employee A("K","1991,11,11",10,20);
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
錯誤 C2084 函式 'void Employee::SetName(std::string)' 的主體已經被宣告了
.....
程式碼(Code):(請善用置底文網頁, 記得排版)
main : http://ideone.com/yaEGAI
employee.h :http://ideone.com/v1WdvU
employee.cpp :http://ideone.com/GQRxrU
補充說明(Supplement):
作者: Jockey66666 (往事已成追憶)   2016-08-05 17:24:00
C2084 msdn 就有答案了
作者: smartjay (高毛毛)   2016-08-05 18:32:00
THX 看懂在.h宣告時多{}造成無法重複
作者: jerryh001   2016-08-05 19:40:00
可以直接點C2084那個字 會出現說明跟範例

Links booklink

Contact Us: admin [ a t ] ucptt.com