Skip to content

Commit

Permalink
Dangling pointer hint.
Browse files Browse the repository at this point in the history
  • Loading branch information
xavierholt committed Oct 20, 2022
1 parent 4b6886b commit 1854001
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions setree/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,7 @@ Implement the following `Set` member functions in `Set.cpp`.
- The standard string comparison operators will give you the correct ordering.
- Storing a `count` (the size of the subtree) on every node is recommended.
- The `insert()` and `remove()` functions will always return one or zero.
- If you get a segmentation fault and the stack trace shows that it's happening
in a `std::string` function, you almost certainly have a dangling pointer to a
node you `delete`d. Check your `remove()` function and make sure you set any
pointers to deleted nodes to `nullptr`!

0 comments on commit 1854001

Please sign in to comment.