home *** CD-ROM | disk | FTP | other *** search
/ APDL Public Domain 1 / APDL_PD1A.iso / program / c / c_tutor / c_2 / pointer < prev    next >
Encoding:
Text File  |  1992-11-14  |  397 b   |  12 lines

  1. main()                      /* illustration of pointer use */
  2. {
  3. int index,*pt1,*pt2;
  4.  
  5.    index = 39;                      /* any numerical value */
  6.    pt1 = &index;                   /* the address of index */
  7.    pt2 = pt1;
  8.    printf("The value is %d %d %d\n",index,*pt1,*pt2);
  9.    *pt1 = 13;           /* this changes the value of index */ 
  10.    printf("The value is %d %d %d\n",index,*pt1,*pt2);
  11. }
  12.