COMPSCI 61C Lecture Notes - Lecture 4: Dereference Operator, Memory Management
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 .