Re: [問題] VC6, VC2003, VC2005

看板Programming作者 (小心課業閉鎖空間...)時間18年前 (2006/06/17 05:46), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串3/4 (看更多)
※ 引述《march20 ()》之銘言: : ※ 引述《CheerC.bbs@binary.csie.ncu.edu.tw ( )》之銘言: : : 請問有誰能回答一下這個問題 : : 就是阿 我們小組寫的象棋程式出了一點問題 : : 同樣的程式碼在VC6編譯出來的程式可以正常執行 : : 但是在2003, 2005編譯(Debug模式)出來的程式 : : 在最後程式要結束之前會錯誤 : : Run-Time Check Failure #2 - Stack around the variable 'sp_icon' was corrupted. : : 如果用Release模式的話就不會有這個問題 : : 請問到底是為什麼呢? : 這跟前幾篇 gyspy 的問題還滿像的, 只不過他的 case 剛好反過來. : 說真的, 沒真的 trace 程式, 不能確定是什麼問題, : 就遇過的實例來說, 問題八成出在 pointer 上. : 要不要檢查看看有沒有 dangling pointer ? dangling pointer好像比較不會破壞到內部堆疊... 找找是不是有陣列存取超出範圍 或者是指標加減弄一弄就弄到不知道指向什麼地方去的指標 -- 'Oh, Harry, dont't you see?' Hermione breathed. 'If she could have done one thing to make absolutely sure that every single person in this school will read your interview, it was banning it!' ---'Harry Potter and the order of the phoenix', P513 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.240.54

06/17 07:02, , 1F
對, 總而言之, 就是 pointer
06/17 07:02, 1F
文章代碼(AID): #14aoQYiB (Programming)
文章代碼(AID): #14aoQYiB (Programming)