Home Segments Index Top Previous Next

410: Mainline

Although pointers are usually longer, short, two-byte pointers are used in the illustrations in this book so as to keep the size of the illustrations manageable.

In the following, for example, a two-byte pointer variable identifies a chunk of memory that contains the address of an object of type cylinder:

     *----- Pointer variable identifies the address of a chunk of  
     |      memory containing a pointer to a cylinder class object 
     |    
     |       *----- Number stored in these 2 bytes is 288 
     |       | 
     v       v 
     ----------------- 
----*--------*--------*-- 
    |00000001|00100000| 
 ---*--------*--------*----- 
     24       25       26       27    
             |  
             | Number 288 identifies the byte where memory 
             | is allocated for a cylinder class object 
             | 
             |     radius         length 
             |       |              | 
             v       v              v 
             --------------- --------------- 
         -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- 
          | | | | | | | | | | | | | | | | | | | | | | 
           -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- 
             ^               ^               ^ 
             |               |               | 
            288             296             304