I\'ve been using C++ for a few years, and today I saw some code, but how can this be perfectly legal?
int main(int argc, char **argv) { size_t size;
This is known as VLAs (variable length arrays). It is standard in c99, but gcc allows it in c++ code as an extension. If you want it to reject the code, try experimenting with -std=standard, -ansi and -pedantic options.
-std=standard
-ansi
-pedantic