CS138 Lecture Notes - Lecture 7: Multiset, Multimap
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;