[comp.os.msdos.programmer] Abnormal .EXE size with Turbo C 2.0

dhinds@portia.Stanford.EDU (David Hinds) (07/16/90)

This is simply a "feature" of the C language.  Static/global variables
are automatically initialized to 0.  Initialized variables all occupy
space in an EXE file.  So, a 32K global variable increases the EXE file
size by 32K of zeros.  If you can't debug a program this big (?!?), you
are in trouble, because it doesn't matter whether or not the EXE file
includes all this space.  The program will need the same amount of space
however you declare the buffer; if it is an automatic variable it will
simply be allocated at runtime.  55K doesn't seem like much of a program:
are you really short on RAM or something?

-David Hinds
  dhinds@popserver.stanford.edu