#include using namespace std; class Matrix { public: Matrix(int r,int c) { row=r; col = c; elem = new double[row*col]; } double &operator( )(int x,int y) { return elem[col*(x - 1) + y - 1]; } ~Matrix() { delete[] elem; } private: double *elem; int row,col; }; void main() { Matrix m(5,8); for (int i=0;i<5;i++) m(i,1)=i + 5; for (int i=0;i<5;i++) cout << m(i,1) << ","; cout << endl; }