I am writing a Matrix2D class. At the beginning I was using constructor as folows,
My code:
Matrix2D(float a,float b, float c,float d)
{
a_=a;
....
}
However, I have just realized that it would be a lot better if I could use multi dimensional array [2][2]. That's where the problem lies,
How do I write constructor for array ?
class Matrix
{
float matrix[2][2];
public:
Matrix2D(float a,float b,float c, float d)
{
matrix[2][2]={a,b,c,d} // not valid
}
}
Just to let you know, I don't ask for a complete code. I just need someone to put me on a right track.