N
Newsnet Customer
<snippet>
....
// overloads the = operator to allow array assignment.
MyArray& MyArray:perator=(const MyArray& old)
{
size = array.size;
ia = new (std::nothrow)int[size];
for (int i=0; i<size; i++)
{
ia = old; //***error indicated here
}
return *this;
}
//end
***error:
passing `const Array2' as `this' argument of `int & Array2:perator
[](int)' discards qualifiers
....
// overloads the = operator to allow array assignment.
MyArray& MyArray:perator=(const MyArray& old)
{
size = array.size;
ia = new (std::nothrow)int[size];
for (int i=0; i<size; i++)
{
ia = old; //***error indicated here
}
return *this;
}
//end
***error:
passing `const Array2' as `this' argument of `int & Array2:perator
[](int)' discards qualifiers