If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Whenever you get a compiler error, it is imperative that you post a valid example. Your example contained numerous errors, and who knows if one error triggers other errors that are unrelated. For example, your constructor is not public, so how can you call it from any function? I made it public, added the appropriate headers, a main() program, and everything compiles successfully.

Re: Writing a simple copy constructor

moreover, note that the parameter "mat" in "Matrix4(float mat[4][4])" does not have type float[4][4] as you might think. Its type is float(*)[4]; this means that you can pass an array float[1][4], float[3][4], etc... to that constructor without any complaint from the compiler but with disastrous effects at runtime.
If you want type checking either pass by reference-to-array or properly write a copy constructor, as suggested by Paul.

This solves the issue of passing by reference, and also addresses the disastrous effects if somewhere in your code you have declared anything but 4 rows and you inadvertently pass it to your functions. The std::array class is a lightweight STL class that wraps an array declaration. So all that's done is to create an array of an array.

If your Matrix class only consists of a 4x4 float array, all you really need is std::array as outlined above, and just typedef it to Matrix4.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.