I would recommend using std::vector<std::vector<double>>. However, given the structure you currently have, you can simply determine operator[]which one returns double *, for example:
double * ddouble::operator[](int i) {
return M[i];
}
Now you can access your variable in mainhow a[i][j].
In addition, you are missing a destructor that frees memory; without it, you have memory leaks. You must define the destructor as:
void ddouble::~ddouble() {
for(int I = 0; I < y; I++) {
delete [] M[I];
}
delete [] M;
}