I for some reason can have a variable sized array. For example main.cpp (it's an attachment) can compile & run perfectly! Can someone tell me why it works and how it doesn't say it works on all the tutorials.
I have not looked through the attachment, but my first guess is that you are using the variable length array extension ported to g++ from gcc's implementation of C99. As such, it is not part of standard C++.