ENG 1002 Lecture Notes - Lecture 9: C Dynamic Memory Allocation, Matlab, In C

7 views5 pages

Document Summary

De-referencing- refers to visiting a referenced address in memory. In week 10 we say that pointers contain addresses, which point to locations in memory, in other words, pointers reference a location in memory. Dereferencing means following a pointer to a memory location. In other words, to un-reference something, or, to go to the place that is being referenced. We"ve seen dereferencing in action with arrays already. Recall: static and dynamic arrays in c are a combination of pointers and lists of data in memory. The square bracket notation [ ] on an array is dereferencing the array. The index number is required when using the square brackets to access individual elements. Pointers that point to a single object (other than arrays) can also be dereferenced too. To dereference, use the asterisk * operator on a point (or address) to access the value at that location in memory. For example: create a pointer to dynamically allocate an integer.

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

Related Questions