I have this program that I am using to add 4*4 matrices:

But the compiler tells meCode:`#include<iostream>`

using namespace std;

class Matrix {

double x[4][4];

public:

Matrix operator+(Matrix);

};

Matrix::Matrix operator+(Matrix mat) {

Matrix temp;

for(int i = 0; i<4; i++)

for(int k = 0; k<4; k++)

temp.x[i][k] = x[i][k] + mat.x[i][k];

return temp;

}

. I don't understand how x can be private to a method that I declared within the class?Quote:

Matrix::x[4][4] is private within this context