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

  1. MEMORG.LST
  2. /* Note: compiler generated file has been edited
  3.  * to fit magazine column.
  4.  */
  5.  
  6. Line#  Source Line  Microsoft C Compiler Version 6.00AX
  7.       1 /*
  8.       2  *  memorg.c
  9.       3  *  Jerzy Tomasik, 12-Jul-1991
  10.       4  *  Data memory organization in a typical
  11.       5  *  C program
  12.       6  */
  13.       7 
  14.       8 #include <stdlib.h>
  15.       9 #include <stdio.h>
  16.      10 
  17.      11 static char str1[] = "This is initialized, static";
  18.      12 static char str2[2048];
  19.      13 char        str3[4096];
  20.      14 
  21.      15 int main(void)
  22.      16     {
  23.      17     char auto_str[512];
  24.      18     char *heap_str;
  25.      19     int  dummy;
  26.      20 
  27.      21     heap_str = malloc(512);
  28.      22 
  29.      23     printf("str1        %Fp\n", str1);
  30.      24     printf("str2        %Fp\n", str2);
  31.      25     printf("str3        %Fp\n", str3);
  32.      26     printf("auto_str    %Fp\n", auto_str);
  33.      27     printf("heap_str    %Fp\n", heap_str);
  34.      28 
  35.      29     free(heap_str);
  36.      30     return(0);
  37.      31     }
  38.  
  39.  
  40. main  Local Symbols
  41.  
  42. Name            Class   Type              Size   Offset
  43.  
  44. dummy . . . . . auto                             -0204
  45. heap_str. . . . auto                             -0202
  46. auto_str. . . . auto                             -0200
  47.  
  48.  
  49. Global Symbols
  50.  
  51. Name            Class   Type              Size   Offset
  52.  
  53. free. . . . . . extern  near function      ***     ***
  54. main. . . . . . global  near function      ***    0000
  55. malloc. . . . . extern  near function      ***     ***
  56. printf. . . . . extern  near function      ***     ***
  57. str1. . . . . . static  struct/array        28    0056
  58. str2. . . . . . static  struct/array      2048    0000
  59. str3. . . . . . common  struct/array      4096     ***
  60.  
  61. Code size = 006c (108)
  62. Data size = 0072 (114)
  63. Bss size  = 0800 (2048)
  64.  
  65. No errors detected
  66.