I am trying to create a function which adds an array to another array and replaces the data in the 1st array with the new data. For example, A=A+B. However, when I write my code as below, I get the error C2676:binary '[' : 'const Matrix' does not define this operator or a conversion to a type acceptable to the predefined operator.
void Matrix::add(const Matrix&m){
for(int i=0; i<9; i++){
data[i]=data[i]+m[i];
}
}
Thanks in advanced for the help!