home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c021 / 7.img / EXAMPLES.ZIP / INTRO31.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-04  |  438 b   |  19 lines

  1. /* INTRO31.C--Example from Chapter 4 of Getting Started */
  2.  
  3. #include <stdio.h>
  4.  
  5. int main()
  6. {
  7.    int intvar = 10;
  8.    int *intptr;
  9.    intptr = &intvar;
  10.  
  11.    printf("Location of intvar: %p\n", &intvar);
  12.    printf("Contents of intvar: %d\n", intvar);
  13.    printf("Location of intptr: %p\n", &intptr);
  14.    printf("Contents of intptr: %p\n", intptr);
  15.    printf("The value that intptr points to: %d\n", *intptr);
  16.  
  17.    return 0;
  18.