I have a class that contains a few multi-dimensional arrays. I am trying to initialize these arrays in the constructor, but I am having trouble figuring our how to do it. The array is always of a fixed size. Here's what I have so far:
class foo {
private:
int* matrix; //a 10x10 array
public:
foo();
foo:foo() {
matrix = new int[10][10]; //throws error
}
the error I get is:
cannot convert `int (*)[10]' to `int*' in assignment
how can I accomplish this? preferably, I would like the array to default to a 10x10 array of all 0s.