Previous Lecture | Lecture 14 | Next Lecture |
Lecture 14, Thu 02/27
Double-Linked Lists and Memory Errors
Topics
- Practice with small single-linked list
- Intro to double-linked lists (define the types we will be working with in the upcoming classes LinkedList, Node)
- Basic operations on double-linked lists: insert, delete, and iterating through the linked list
- Problems with dynamic memory: memory leaks and dangling pointers
- Dynamic memory pitfalls: memory leaks (how to avoid and detect (valgrind))
-
Detecting memory errors: Use valgrind
- To run your code in valgrind use the following command:
valgrind --leak-check=full <name of your executable>