作者u8906250 (陷入猫的国度 就当只猫吧)
看板Programming
标题Re: [问题] 有关pointer
时间Wed Nov 1 14:02:57 2006
※ 引述《[email protected] (汀)》之铭言:
: ※ 引述《[email protected] (小浩浩)》之铭言:
: > 好久没写程式了 功力变很逊
: > 想问一下有关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