CMPSC 16 Lecture Notes - Lecture 12: Valgrind, Memory Leak, A.Out

40 views1 pages
14 Nov 2018
School
Course
Professor

Document Summary

Arrays, pointers, references, dynamic memory (new and delete) Node *p = head; //head is a pointer. The pointer is pointing to the address stored in head, which is the 1st value of the node/struct. P->next; //a way to access the memory address of the next node. A memory leak can still occur if the nodes are not deleted. Memory leak occurs when something is created on the heap but never removed. Run through valgrind to check if there are memory leaks. Compile with the -g option first: g++ -g file. cpp. Valgrind needs to be installed; already assigned on the csil machines.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents