Re: [問題] 有關pointer

看板Programming作者 (陷入貓的國度 就當隻貓吧)時間18年前 (2006/11/01 13:33), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/4 (看更多)
※ 引述《tinlans.bbs@whshs.cs.nccu.edu.tw (汀)》之銘言: : ※ 引述《howay0516.bbs@ptt.cc (小浩浩)》之銘言: : > 好久沒寫程式了 功力變很遜 : > 想問一下有關pointer的問題 : > 某 function(){ : > // Start find shortest path : > // grids[][] and Input[][] two int dimensions array... : > FindShortestNum( grids, Input ); : > } : > void FindShortestNum( int** grids, int** Input ){ // test OK : > //上面的這個參數要怎樣傳啊>"< 謝謝願意回答的強者 : > //目前這樣是錯誤 : > .... : > ... : > ... : > } : 不可以這樣傳, : 除非你硬轉 type, : 詳情請參閱前幾天「請問二維陣列傳值的問題」的討論串。 我都是用struct取代二維陣列 像是 struct row { int item[10]; } 再宣告struct陣列 struct row grids[10]; 這樣在傳參數時就很方便... -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.29.241.8
文章代碼(AID): #15I36Zlt (Programming)
討論串 (同標題文章)
文章代碼(AID): #15I36Zlt (Programming)