Original Post
I have an array of 4 pointers in a class called QuadTree.
In my constructor, how do I initialize each of these pointers to NULL
class QuadTree {
public:
QuadTree();
~QuadTree();
private:
QuadTree *children[4];
}
Like this:
QuadTree::QuadTree():children(NULL) {}
or like this:
QuadTree::QuadTree() {
for (int i = 0; i < 4; i++) children = NULL;
}
Thanks,
Edo