hello,
I am in a problem in creating an array of dynamic memory.This is a program of 2D array which is handled by double pointers.If i have a 3*3 matrix then, for this I have three pointer for row and each row points to another three columns through another three pointers.The problem is that everything is compiling except line 12..can anyone help me please.Note that i have also assignment operator and copy constructor as well.


Code:
class array{

private:

**data; int r, int c;

public:

int& operator()(unsigned int i ,unsigned int j); //operator overloading

array::array(unsigned int row,unsigned int col)

{
    r = row;
    c = col;
    data = new int *[r];
    
    for (int i=0;i<r;i++)
    *data[i] = new int[c];  //error:cannot convert int* to int
   
}

int& array::operator()(unsigned int i,unsigned int j)    // operator overloading
{
  
   return *(*(data + i *j));    
}