[問題] overload operators的問題
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Xcode
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
輸出的數字跟想像中的不同
餵入的資料(Input):
3,4
6,2
預期的正確結果(Expected Output):
9,6
-3,2
錯誤結果(Wrong Output):
(3,2)+(6,4)=(134516496,134516498)
(3,2)-(6,4)=(134516496,134516498)
程式碼(Code):(請善用置底文網頁, 記得排版)
http://ideone.com/JhXcFl
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 172.250.212.103
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1459478159.A.162.html
推
04/01 12:45, , 1F
04/01 12:45, 1F
→
04/01 13:08, , 2F
04/01 13:08, 2F