I'm working in Vs2010 c++ with 2D arrays. I started off with a 1D pointer and used the operation [] as the following:
class CMatrix
{
void clear();
public:
int nRows;
int nCols;
short * MyMat;
CMatrix();
CMatrix(int r,int c);
~CMatrix(void);
void SetMatrix(int r,int c);
short * operator[] (const int row)
{
return MyMat + (row*nCols);
}
};
I don't mind to change to 2D pointer.
However my problem is with debug. Because I'm using pointers I can't see the arrays content.
Are there any another options ?
I prefer not to use vector.