I\'m not a C++ expert, but as far as I know this code should fail due to size not being constant:
size
#include using namespace std;
Because you don't invoke g++ as a C++ compiler. If I try it, I get a warning, stating clearly that "ISO C++ forbids variable length array". But my makefiles include the option -std=c++98, at least when I want to compile portable C++.
-std=c++98