[問題] C++Primer,4ed中文版,p598頁...
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
VC
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
這本課本的範例跑不起來..
http://codepad.org/FmgA9HrQ
餵入的資料(Input):
預期的正確結果(Expected Output):
課本的預期結果,上面兩個有編譯錯誤的地方,應該是執行期才決定的,但是卻變成
編譯錯誤
錯誤結果(Wrong Output):
錯誤 1 error C2662: 'Item_base::net_price' : 無法將 'this' 指標從 'const Item_base' 轉換成 'Item_base &' g:\cpp\hello\hello\hello.cpp 28 hello
錯誤 2 error C2662: 'Item_base::net_price' : 無法將 'this' 指標從 'const Item_base' 轉換成 'Item_base &' g:\cpp\hello\hello\hello.cpp 29 hello
程式碼(Code):(請善用置底文網頁, 記得排版)
http://codepad.org/FmgA9HrQ
補充說明(Supplement):
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.40.121.162
→
08/07 15:21, , 1F
08/07 15:21, 1F
→
08/07 20:57, , 2F
08/07 20:57, 2F
→
08/07 22:33, , 3F
08/07 22:33, 3F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章