home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_04 / 8n04054a < prev    next >
Text File  |  1990-03-20  |  842b  |  27 lines

  1. *****Listing 2*****
  2.  
  3.    double d[5] = {1., 2., 3., 4., 5.};
  4.                        /* Assume this starts address 100 */
  5.    double *ch;
  6.    double e;
  7.  
  8.    ch = d;             /* 100 placed into ch */
  9.  
  10.   *(ch++) = 5.;        /* 5. placed in d[0]
  11.                           ch incremented to 108. 
  12.  
  13.    ++(*ch);            /* Contents of d[1] (at address 108)
  14.                           incremented by 1, to 3. */
  15.    
  16.    *(++ch) = 7.;       /* ch incremented to 116 
  17.                           7. placed in d[2]  (at address 116) */
  18.  
  19.    (*ch)++             /* The 7. at d[2] is incremented to 8. */
  20.  
  21.    e = ++(*ch);        /* The 8. at d[2] is incremented to 9.
  22.                           9. is placed in e */
  23.  
  24.    e = (*ch)++;        /* The 9. at d[2] is placed in e 
  25.                            d[2] is incremented to 10. */
  26.  
  27.