Hierarchical structure and cosmic voids in C++