Mail Archives: djgpp/2000/07/16/16:13:40
Hi.
At Sat, 15 Jul 2000 18:06:38 -0500, you wrote:
> I use many global arrays in my program and I am puzzled because the
>binary size
>increase does not reflect sizeof ( _new_array).
>As an example, adding : unsigned long long _BITMAP [ 64 ]; (sizeof is
>512),
>produces a binary size increase of only about 53 bytes. This last number
>varies from
>49 to 53.
If the array is not initialized as part of its
declaration, most systems don't actually put the entire
array in the executable. Instead, it puts information
that tells the OS that the program needs an array of
size "n". So regardless of the size of the array, you
only get the 49-53 bytes that contain the information
on the array.
Depending on the OS, you may see the same type of behavior if the array is initialized to all zero, or maybe even all the same value (i.e., all "9"s or
something).
---------------
Let's Go Canes!
- Raw text -