[問題] 二維動態陣列的問題
開發平台(Platform): (Ex: Win10, Linux, ...)
Linux
編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出)
gcc
問題(Question):
各位大神大家好,小弟正在做資料結構的作業,因為就教授要求必須用二為維動態陣列,
但是遇到一些錯誤狀況,在delete的時候會跑出錯誤狀況:
Error:free(): invalid next size(fast)
餵入的資料(Input):
n 為 欲排列的個數
amax amin 為產生隨機變數區間
rseed 為種子
預期的正確結果(Expected Output):
錯誤結果(Wrong Output):
Error:free(): invalid next size(fast)
程式碼(Code):(請善用置底文網頁, 記得排版,禁止使用圖檔)
https://ideone.com/GIdoRv
補充說明(Supplement):
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.173.139.63
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1545846887.A.BB1.html
→
12/27 08:36,
7年前
, 1F
12/27 08:36, 1F
推
12/27 08:40,
7年前
, 2F
12/27 08:40, 2F
推
12/27 21:34,
7年前
, 3F
12/27 21:34, 3F
→
12/28 02:18,
7年前
, 4F
12/28 02:18, 4F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章