[問題] 新手問題

看板C_and_CPP作者 (rayark)時間5年前 (2018/10/17 07:32), 5年前編輯推噓1(101)
留言2則, 2人參與, 5年前最新討論串7/7 (看更多)
開發平台(Platform): (Ex: Win10, Linux, ...) win10 編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出) visual studio 2017 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) 問題(Question): https://i.imgur.com/HVILwoa.png
為何第14行會顯示錯誤碼C4146? 還有我想知道變數'0'怎麼打(包括單引號 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): 程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔) 補充說明(Supplement):菜雞自學,請多多包涵 -- Sent from PTTopia -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 47.7.144.108 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1539732749.A.FED.html ※ 編輯: rayark2016 (47.7.144.108), 10/17/2018 07:33:51 ※ 編輯: rayark2016 (47.7.144.108), 10/17/2018 07:35:34 ※ 編輯: rayark2016 (47.7.144.108), 10/17/2018 07:37:01 ※ 編輯: rayark2016 (47.7.144.108), 10/17/2018 07:38:02 ※ 編輯: rayark2016 (47.7.144.108), 10/17/2018 07:39:42

10/17 10:36, 5年前 , 1F
13行的變數超過long的範圍了 改成unsigned long
10/17 10:36, 1F

10/17 20:51, 5年前 , 2F
如果你是要查變數範圍 可以用climits函式庫確認
10/17 20:51, 2F
文章代碼(AID): #1RndKD_j (C_and_CPP)
文章代碼(AID): #1RndKD_j (C_and_CPP)