home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_10 / 9n10074a < prev    next >
Text File  |  1991-08-21  |  636b  |  32 lines

  1. /*
  2.  *  memorg.c
  3.  *  Jerzy Tomasik, 12-Jul-1991
  4.  *  Data memory organization in a typical
  5.  *  C program
  6.  */
  7.  
  8. #include <stdlib.h>
  9. #include <stdio.h>
  10.  
  11. static char str1[] = "This is initialized, static";
  12. static char str2[2048];
  13. char        str3[4096];
  14.  
  15. int main(void)
  16.     {
  17.     char auto_str[512];
  18.     char *heap_str;
  19.     int  dummy;
  20.  
  21.     heap_str = malloc(512);
  22.  
  23.     printf("str1        %Fp\n", str1);
  24.     printf("str2        %Fp\n", str2);
  25.     printf("str3        %Fp\n", str3);
  26.     printf("auto_str    %Fp\n", auto_str);
  27.     printf("heap_str    %Fp\n", heap_str);
  28.  
  29.     free(heap_str);
  30.     return(0);
  31.     }
  32.