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

看板C_and_CPP作者 (高毛毛)時間7年前 (2016/08/05 17:17), 7年前編輯推噓0(003)
留言3則, 3人參與, 最新討論串1/1
開發平台(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): -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 60.249.142.114 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1470388647.A.96A.html ※ 編輯: smartjay (60.249.142.114), 08/05/2016 17:20:33

08/05 17:24, , 1F
C2084 msdn 就有答案了
08/05 17:24, 1F

08/05 18:32, , 2F
THX 看懂在.h宣告時多{}造成無法重複
08/05 18:32, 2F

08/05 19:40, , 3F
可以直接點C2084那個字 會出現說明跟範例
08/05 19:40, 3F
文章代碼(AID): #1Nf5cdbg (C_and_CPP)