I have a class called MATRIX with element[4][4] array and some other functions for adding, subtracting, etc.
I want to insert an entire array value into the matrix from the main function, but I keep getting errors.
Here's the code:
class MATRIX
{
public:
float ele[4][4];
float rows;
float cols;
MATRIX Add(MATRIX m);
MATRIX Subtract(MATRIX m);
MATRIX Multiply(MATRIX m);
MATRIX Transpose();
MATRIX Initialize();
};
int main(int argc, char ** argv){
float x_angle = 0, y_angle = 0, z_angle = 0;
MATRIX xRotation, yRotation, zRotation;
xRotation.ele = {
{ 1, 0, 0, 0 },
{ 0, cosf(x_angle), -sinf(x_angle), 0 },
{ 0, sinf(x_angle), cosf(x_angle), 0 },
{ 0, 0, 0, 1 } };
}
The error message tells me that the expression must be a modifiable lvalue