home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_06 / v7n6028a.txt < prev    next >
Text File  |  1989-07-25  |  640b  |  32 lines

  1. #include <stdio.h>
  2.  
  3. struct {
  4.     char c1;
  5.     short s;
  6.     char c2;
  7.     int i;
  8.     char c3;
  9.     long l;
  10.     char c4;
  11.     float f;
  12.     char c5;
  13.     double d;
  14.     char c6;
  15.     int *p;
  16.     char c7;
  17. } structa;
  18.  
  19. main()
  20. {
  21.     printf("sizeof(structa) = %lu\n",
  22.         (unsigned long) sizeof(structa));
  23.     printf("&structa   = %p\n", (void *) &structa);
  24.     printf("&structa.s = %p\n", (void *) &structa.s);
  25.     printf("&structa.i = %p\n", (void *) &structa.i);
  26.     printf("&structa.l = %p\n", (void *) &structa.l);
  27.     printf("&structa.f = %p\n", (void *) &structa.f);
  28.     printf("&structa.d = %p\n", (void *) &structa.d);
  29.     printf("&structa.p = %p\n", (void *) &structa.p);
  30. }
  31.  
  32.