Hello all ... i want to show the element of mat[2][2] using cout (<<) operator overloading.How can i do this ??Code:#include <iostream> #include <cstring> using namespace std; class Matrix{ private: int i,j; public: int mat[5][5]; Matrix(int x,int y,int p){ for(i=0;i<x;i++)for(j=0;j<y;j++)mat[i][j]=p; } }; int main(){ Matrix m(5,5,1); cout << m(2,2) << endl; return 0; }
Thanks in advance