Home Segments Index Top Previous Next

310: Mainline

Given that iptr is a pointer variable, the chunk of memory allocated for iptr contains the address of a chunk of memory allocated for an integer.

Thereafter, iptr, without an asterisk, refers to the location of an address; *iptr, with an asterisk, refers to the location of the integer identified by the address:

     iptr refers to the address of the byte where a 
     pointer to an integer object begins; here, the 
     value of iptr is 88, an address 
      | 
      | 
      v 
     iptr 
----*--------*--------*-- 
    |00000000|01011000| 
 ---*--------*--------*----- 
     24       25       26       27    
     ----------------- 
             | 
             |  
             | The number, 88, identifies the place where memory 
             | is allocated for an integer object; here, the 
             | value of *iptr is 1943, an integer 
             | 
             | 
             v 
        ----*--------*--------*--------*--------*-- 
            |00000000|00000000|00000111|10010111| 
         ---*--------*--------*--------*--------*----- 
             88       89       90       91