Hi, lets ignore the fact that this is very bad matrix class. The elements are being allocated in the line no matter what the dimensions are. I just tried to create operator[]() for fun and optional member function default_init() that initializes every element to default. So it can be used if elements actually have default value.
On visual studio this code dont really work because when I cout << elements in main() they have all kinds of random values.
If I run this on cpp.sh that every element is correctly initialized to its default value 0.
It didn't work on cpp.sh ; on cpp.sh, you only set the first to zero. The other values could be anything at all. On cpp.sh, it seems that they happen to be zero.