
Originally Posted by
mickey
What do you mean? What's the reason lead me to allocate the vecNode(in the main) in on the stack or on heap?
I mean dont create the vecNode using new. that is, dont use
vector<Node> *listNode = new vector<Node>;
vector<Node> *listNode = new vector<Node>;
To copy to clipboard, switch view to plain text mode
Instead use
vector<Node> listNode;
vector<Node> listNode;
To copy to clipboard, switch view to plain text mode
This removes explicit new and delete operations and simplifies code in many places. Ofcourse this is not mandatory, you might find the first solution suitable in your case.
@Wysota: Yeah, that is the reason i told it is unconventional. But it is not "unmaintainable" - atleast in a group of experienced c++ programmers.
Bookmarks