You should read this: http://cplusplus.com/doc/tutorial/dynamic/
But if you havent learnt much about pointers, you shouldnt be doing this i think, because you probably wouldnt understand(pointers are probably the most annoying but useful things youll meet in c++)
Alright, heres an example;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
class matrix
{
constint x;
constint y;
int** value;
public:
matrix(int ,int );
};
matrix::matrix(int a,int b)
{
x=a;
y=b;
value = newint*[a];
for(int i = 0; i < a; i++)
{
value[i] = newint[b];
}
}