CS138 Lecture Notes - Lecture 7: Multiset, Multimap

54 views3 pages

Document Summary

Memory/storage for your variables comes from one of two possible places: run-time stack handles automated allocation & de-allocation for parameters and local variables as procedures are called. This storage automatically disappears when the procedure finishes executing: freestore / the heap handles all programmatic requests for storage via malloc and. New (for objects, structs, and anything else c++ style) Program must return this storage when done with it via free or delete. Ex: ballon *b = new balloon; Object it points to is on heap string val; Node* next; struct node { int main() { Node *p; p = new node; p -> val = first; p -> next = null; Node* q,r; r. val = flurble; q = new node; q -> next = p; q -> val = second; Node* s = new node; s -> val = third; s -> next = q; Node temp=s; while (null != temp) { cout< val << endl; temp = temp-> next;

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