COMPSCI 61C Lecture Notes - Lecture 4: Dereference Operator, Memory Management

44 views3 pages

Document Summary

O ce hours: monday 11 am - 12 pm. Let head gsis know about exam con icts by the end of this week. Consider memory to be a single huge array. Each cell has an address associated with it. Don"t confuse the address referring to a memory location with the value stored there. Address: refers to a particular memory location; e. g. , it points to a memory location. Pointer: a variable that contains the address of the variable. Tells compiler that variable p is an address of an int p = &y; Tells compiler to assign address of y to p. & called the address operator in this context z = *p; Tells compiler to assign value at address in p to z. * calls the dereference operator in this context. * operator: get the value that the pointer points to. Java and c pass parameters pass by value .

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