home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / turbo_c / trbocsrc.arc / POINTER.C < prev    next >
Text File  |  1988-02-01  |  505b  |  13 lines

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