Original Post
Hi there, I''m using Masm32 (assembler) however I believe the same concepts are true in other programming languages. In Masm there are two sections to declare your variables:
.data
and
.data?
.data is the intialised data and the other is uninitialised data. From my understanding Initialised data has it''s values stored within the executable. So a string with a value of "Hello" would take up 5 or more bytes within the executable. At load time the program will allocate the 5 bytes and put that value into the variable hence it''s initialised..
Now for the unitialised data my understanding is that NO value at all not even NULL or 0 is saved within the executable, so it doesn''t take up more space and at load time the size requested is allocated but is not initialised so the values remain whatever it was before my use, could be anything no guarentees. Hence you should initialise it by seting it to 0 or NULL.
Is this correct? If not please correct me!
Thanks,
Ben