Re: How to "define" a struct
by Peter Duniho on 10/31/2007 12:17:00 PM
On 2007-10-31 18:27:03 -0700, Arne Vajhøj <arne@vajhoej.dk> said:
> Peter Duniho wrote:
>> On 2007-10-31 16:43:16 -0700, PLS <nobody@nowhere.com> said:
>>> I'm confused. Structs have a default constructor that sets the memory to
>>> binary zeros, so the struct is defined.
>>
>> That's a false conclusion. All types have a default constructor.
>
> No. Maybe value types have.
You're right...I didn't express myself very well there. My point is
that having a default constructor is not a sufficient condition for a
local variable being considered to be "definitely assigned" (which is
what the OP) is talking about, as even non-struct value types (int,
bool, etc.) have default constructors but aren't automatically
"definitely assigned" as a result.
Pete