看板 C_and_CPP 關於我們 聯絡資訊
開發平台(Platform): (Ex: Win10, Linux, ...) Win10 編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出) VC++ 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): 小弟有以下疑惑: C++的constructor可以用assignment和initializer兩種寫法,不知道有沒有大神能夠解釋或是說明什麼情況用initializer較佳或assignment較佳,感謝! 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): 程式碼(Code):(請善用置底文網頁, 記得排版) 補充說明(Supplement): ----- Sent from JPTT on my Samsung SM-G930F. -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 180.217.164.77 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1509252179.A.C6A.html
loveflames: 你是想問copy-init跟direct-init嗎 11/03 22:59