小编jus*_*tin的帖子

从函数返回多维数组

如何返回存储在a中的多维数组 private我的类字段中?

class Myclass {
private:
   int myarray[5][5];
public:
   int **get_array();
};

// This does not work:
int **Myclass::get_array() {
    return myarray;
}
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

无法转换int (*)[5][5]int**回报

c++ multidimensional-array

21
推荐指数
3
解决办法
1万
查看次数

标签 统计

c++ ×1

multidimensional-array ×1