Suppose I define a class called Matrix
My question is: how to overload Matrix[i][j] which take two integers i and j as parameters?Code:template <class T> class Matrix { ...... private: vector< vector<T> > data; };
This is an interview question that I was asked, and the interviewer precluded the way of using Matrix(i,j). Thanks a lot.




Reply With Quote