If I declare a struct node, is the following legal in C++? node nodes_array[vector.size()]; I know this is not legal in C. However, my C++ compiler does not complain. Is this only in recent versions of C++, or has this always been legal in C++?

Depends on the compiler -- most c++ compilers will complain about that.

In C99, the latest C standard, that would be legal. (Well, not the "vector.size()", but the runtime initialization of the array size.) You can use

scoped_array<node> nodes_array(new node[vector.size()]);

instead -- if you have the boost libraries installed.