怎样在类里面定义一个不定长度的数组?
#include <iostream>
using namespace std;
class WWW
{public:
WWW(int a,int b):x(a),y(b){}
private:
const int x,y; // x y是静态的,可变的,怎样才能实现呢?
int m[x][y];
};
#include <iostream>
using namespace std;
class WWW
{public:
WWW(int a,int b):x(a),y(b){}
private:
const int x,y; // x y是静态的,可变的,怎样才能实现呢?
int m[x][y];
};
谢谢个位拉,我是个新手啊,55555555,我们书都快学完了,都没学过动态的,所以不知道还能用这种方法,我会去学的了!~