convert malloc to new c++ for struct

In C++, it would be achieved with this.

std::vector<node *> problem(length);

The code you show is effectively emulating a small subset of the features of vector. Namely, an array-like container that is aware of its size.

Leave a Comment