home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / tyc / list9_2.c < prev    next >
C/C++ Source or Header  |  1993-10-16  |  711b  |  30 lines

  1.  /* Demonstrates the relationship between addresses and */
  2.  /* elements of arrays of different data types. */
  3.  
  4.  #include <stdio.h>
  5.  
  6.  /* Declare three arrays and a counter variable. */
  7.  
  8.  int i[10], x;
  9.  float f[10];
  10.  double d[10];
  11.  
  12.  main()
  13.  {
  14.      /* Print the table heading */
  15.  
  16.      printf("\t\tInteger\t\tFloat\t\tDouble");
  17.  
  18.      printf("\n================================");
  19.      printf("======================");
  20.  
  21.      /* Print the addresses of each array element. */
  22.  
  23.      for (x = 0; x < 10; x++)
  24.          printf("\nElement %d:\t%d\t\t%d\t\t%d", x, &i[x],
  25.              &f[x], &d[x]);
  26.  
  27.      printf("\n================================");
  28.      printf("======================");
  29.  }
  30.