So, I have declared a typedef as:
typedef float Matrix4[4][4];
when I try to Initialize it as:
void getXRotationMatrix(float theta, Matrix4 ans) {
ans = { {0,0,0,0},{1,1,1,1},{0,0,0,0},{1,1,1,1} };
}
it gives an error:
too many initializer values
however, it works when I initialize it as:
void getXRotationMatrix(float theta, Matrix4 ans) {
float a[4][4] = { {0,0,0,0},{1,1,1,1},{0,0,0,0},{1,1,1,1} };
ans = a;
}
It doesn't give any error. Can someone please explain?