Hi,
I have implemented my first C++ class as following thanks to the generous help of Ancient Dragon:
typedef unsigned long ULONG;
class CMatrix
{
public:
CMatrix(const CMatrix& m);
CMatrix(size_t row, size_t col);
ULONG sum();
size_t s_row();
size_t s_col();
CMatrix& operator *= (const CMatrix& m);
private:
size_t _s_row;
size_t _s_col;
vector< vector<short> > base_mat; // for storing the elements the matrix.
};
The trouble now is, I can design the function body of
CMatrix(size_t row, size_t col);
, but have no opinion about the function body of
CMatrix(const CMatrix& m);
, since the CMatrix class has several members, the function seems not to be as easy as an operation collection of assignments. Any one can give me some advice? thank u in advance.