Mail Archives: djgpp/1997/11/25/07:15:28
On Mon, 24 Nov 1997, sl wrote:
> >If you allocate the array dynamically at run-time at the start of main()
> >then you will have a reasonable .exe size and equivalent function.
>
> That is the dumbest thing I have ever heard.
^^^^^^^
Please refrain from calling replies posted by others as ``dumb''.
People who offer free help here don't deserve it, even if they are
dead wrong. It is okay to correct somebody's message, but flaming
them for offering help is something we should try to avoid.
> You are allocating MEMORY here, not diskspace!
Nevertheless, Paul's suggestion *does* make sense: by switching from
statically allocated array to one that's allocated at run time, the
disk image doesn't get bloated by the initialized array.
> Regardless of if you allocate the array staticly or dynamically it
> should NOT use up diskspace!
This cannot be done in all cases. For example, if the array is
initialized by values other than zeroes, the linker has no other way
than to write all those values into the disk .exe file.
- Raw text -