how to use a dynamically created one-dimensional array by a two-dimension array reference only with standard library?
could it be done by construct overloading of operator []
?
example: i want to form a matrix by creating a one-dimension array and then use it in the form of using a two-dimension array.
// in class, a matrix created by:
p = new double[m*n]();
when using it, I'd like to use it like this:
for(i=0; i<10; i++)
for(j=0; j<10; j++)
a[i][j] = 0.0;
i thought of using operator overloading of operator []
and a variable test to testify if the "[]" appeared for the first time or not, but above turned out to be a
error: "invalid types
double[int]
for array subscript "
is that possible to do so?