Home Segments Index Top Previous Next

305: Mainline

To establish a proper value for a pointer variable, you need to know about the address-of operator, &. Whenever an expression identifies a value-holding chunk of memory, then operating on that expression with the address-of operator returns the address of that chunk of memory.

If i identifies a chunk of memory allocated to hold the value of an integer object, then &i is the address of that chunk of memory. In the following illustration, the value of i is 1943, inasmuch as the binary number 11110010111, rendered in ordinary decimal notation, is 1943. The value of &i, the address of the chunk of memory holding 1943, is 88 in decimal:

     i 
----*--------*--------*--------*--------*--------*-- 
    |00000000|00000000|00000111|10010111|        | 
 ---*--------*--------*--------*--------*--------*-----               
     88       89       90       91     <-- Addresses