#include #include using namespace std; class simple_array { public: double &operator()(int i,int j); private: double a[5][5]; }; double &simple_array::operator()(int i,int j) { if (i<1 || j<1 || i>5 || j>5) { cout << " Error - index out of range \n"; exit(EXIT_FAILURE); } return a[i-1][j-1]; } int main() { simple_array x; int i,j; for ( i=1;i<=5;++i) for ( j=1;j<=5;++j) x(i,j)=i*j; for ( i=1;i<=5;++i) for ( j=1;j<=5;++j) cout << x(i,j) << " "; x(11,6)=1.1; return(0); }