Test your class definition with this main program. Save your class definition in "matrix.h" and compile the program with "clang++ matrix-5.cpp". The running result may look the following. Please note that the calling order and numbers of constructors and destructors may be different, according to the optimization mechanisms of compilers. However, the results of the two matrices should be correct.
Constructor called for a 3*4 matrix.
Constructor called for a 3*4 matrix.
Constructor called for a 3*4 matrix.
Copy Constructor called for a 3*4 matrix.
Destructor called for a 3*4 matrix.
3 3 3 3
3 12 3 3
3 3 101 3
Constructor called for a 4*3 matrix.
3 3 3
3 12 3
3 3 101
3 3 3
Destructor called for a 4*3 matrix.
Destructor called for a 3*4 matrix.
Destructor called for a 3*4 matrix.
Destructor called for a 3*4 matrix.