Hello,
I dont know how to overload [][] operator. I've tried but it's not working. This is what i have done so far.
Code:#include <iostream.h>
#include <assert.h>
class array
{
public:
int a[5][5];
int &operator[][](int,int);
};
int &array::operator[][](int b,int c)
{
assert(b>0 && c>0 && b<5 && c<5);
return a[b][c];
}
int main(void)
{
array A;
cout<<A[4][3];
return 0;
}