digitalmars.D - Does 'new' fill the memory.
- Questiom <Questiom_member pathlink.com> Sep 30 2005
- bobef <bobef lessequal.com> Sep 30 2005
- "Jarrett Billingsley" <kb3ctd2 yahoo.com> Sep 30 2005
- Ivan Senji <ivan.senji_REMOVE_ _THIS__gmail.com> Oct 01 2005
- "Jarrett Billingsley" <kb3ctd2 yahoo.com> Oct 01 2005
for example char []a=new char[55]; Does the 'new' operator fill the array with 0 or can there be some crap in a[]? I could not find it from specification. Does anybody know?
Sep 30 2005
Questiom wrote:for example char []a=new char[55]; Does the 'new' operator fill the array with 0 or can there be some crap in a[]? I could not find it from specification. Does anybody know?
Specs says, if I remember correctly, that all variables in D are automatically initialized (if they are not void initialized or whatever it was called).
Sep 30 2005
"Questiom" <Questiom_member pathlink.com> wrote in message news:dhk1ur$26bt$1 digitaldaemon.com...Does the 'new' operator fill the array with 0 or can there be some crap in a[]? I could not find it from specification. Does anybody know?
Yes, it is filled with the type's initializer (in this case 0).
Sep 30 2005
Jarrett Billingsley wrote:"Questiom" <Questiom_member pathlink.com> wrote in message news:dhk1ur$26bt$1 digitaldaemon.com...Does the 'new' operator fill the array with 0 or can there be some crap in a[]? I could not find it from specification. Does anybody know?
Yes, it is filled with the type's initializer (in this case 0).
Char is initialied with 0xFF not 0.
Oct 01 2005
"Ivan Senji" <ivan.senji_REMOVE_ _THIS__gmail.com> wrote in message news:dhmaeu$l6g$1 digitaldaemon.com...Char is initialied with 0xFF not 0.
Crap. Forgot about that.
Oct 01 2005









bobef <bobef lessequal.com> 