Pointers and Memory Addresses
Before we end this discussion of pointers in Objective-C, we should point out the details of how they are actually implemented. A computer’s memory can be conceptualized as a sequential collection of storage cells. Each cell of the computer’s memory has a number, called an address, associated with it. Typically, the first address of a computer’s memory is numbered 0. On most computer systems, a cell is 1 byte.
The computer uses memory to store the instructions of your computer program and to store the values of the variables associated with a program. So if you declare a variable called count
to be of type int
, the system assigns locations in memory to hold the value of count
while the program is executing. For example, ...
Get Programming in Objective-C, Sixth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.