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+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