On Sep 23, 11:00 am, Maxim Yegorushkin <maxim.yegorush...@gmail.com>
wrote:
On Sep 22, 4:37 pm, Salt_Peter <pj_h...@yahoo.comwrote:
On Sep 22, 11:02 am, vineet <vinsha...@gmail.comwrote:
To make data aligned to memory boundry, compiler pedded
some byte. I wanted to know if these bytes are
initialized? or compiler pedded some un initialized byte.
The padding, if any, is not initialized.
In fact neither is the data unless you have done so.
Unless it is POD with static storage duration, in which case
it is guaranteed to be zero-initialised.
The members, for types where zero initialization makes sense
(not references, for example). And this is guaranteed to occur
even within types with constructors, etc.; zero initialization
takes place before any dynamic initialization. But the original
question concerned padding, and that's not guaranteed (for the
obvious reason that what is meant by zero initialization depends
on the type, and padding has no type).
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34