CS 2150 Lecture Notes - Lecture 5: Mutator Method, Local Variable, Dangling Pointer

37 views1 pages

Document Summary

Y is a regular character (8 bits) and x is a pointer (32 bits): doubly linked lists, head and tail are just dummy list nodes so that every insert is between two existing b. list nodes. Do not declare a variable of the same name in the method. In the 2nd foo(), creating a variable temp and it gets deallocated once out of scope. Do not make things point to local variables because it will get deallocated later on: references, references are memory addresses but they operate under some diferent rules, act like b. pointers. In some cases, & means getting the address of but sometimes it means declaring a reference: reference is just like a pointer, holds an address, but: Implicit dereferencing iii: swap() with pointers involves dereferencing explicitly, don"t care what the address is , but c++ a.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents