相关疑难解决方法(0)

声明一个在头文件中返回2D数组的函数?

我试图在我的头文件中声明一个返回2D数组的函数.考虑到我们已经知道阵列的大小,怎么能实现呢?以下是我目前正在做的事情.

class Sample
{
public:
    char[x][y] getArr();
    void blah(int x, int y);
private:
    const static int x = 8;
    const static int y = 2;
    char arr[x][y];
};
Run Code Online (Sandbox Code Playgroud)

c++ arrays declaration header-files

1
推荐指数
2
解决办法
2235
查看次数

标签 统计

arrays ×1

c++ ×1

declaration ×1

header-files ×1