u01: Null pointers in main after delete
This commit is contained in:
parent
6a7c1c4546
commit
65f13d8780
|
@ -3,8 +3,10 @@
|
|||
int main(int argc, char **argv) {
|
||||
node *t = create_complete_tree(2, 4);
|
||||
delete t;
|
||||
t = nullptr;
|
||||
node *root = new node("root");
|
||||
root->add_child(new node("left child"));
|
||||
root->add_child(new node("right child"));
|
||||
delete root;
|
||||
root = nullptr;
|
||||
}
|
||||
|
|
Reference in a new issue