我在程序中遇到了问题。当我将3D int数组CodedGreen传递给函数Green_Decode_Tree时。显示错误消息“无效使用未指定边界的数组”。我的程序中有什么错误?谢谢你的帮助。无法使用未指定边界的数组
for(i=0;i<256;i++){
for(j=0;j<256;j++){
Decode_Tree(green[0], CodedGreen,0,i,j);
}
}
void Green_Decode_Tree(node* tree, int code[][][], int num,int row,int col)
{
int i;
i=num;
if((tree->left == NULL) && (tree->right == NULL)){
fprintf(DecodGreen,"%s\n", tree->ch);
}
else
{
if(code[row][col][num]==1){
i++;
Green_Decode_Tree(tree->left,code,i,row,col);
}
else if (code[row][col][num]==0){
i++;
Green_Decode_Tree(tree->right,code,i,row,col);
}
}
}
看到这个:http://stackoverflow.com/questions/4051/passing-multidimensional-arrays-as-function-arguments-in-c,特别是http://www.eskimo.com/~scs/ cclass/INT/sx9a.html – 2010-03-18 12:18:39