Re: Anyone knows what can be cause of this problem?
From: Andrey Tarasevich (andreytarasevich_at_hotmail.com)
Date: 02/20/04
- Next message: Phlip: "Re: return const and assert"
- Previous message: Andrey Tarasevich: "Re: Anyone knows what can be cause of this problem?"
- In reply to: Karl Heinz Buchegger: "Re: Anyone knows what can be cause of this problem?"
- Next in thread: Rob Williscroft: "Re: Anyone knows what can be cause of this problem?"
- Reply: Rob Williscroft: "Re: Anyone knows what can be cause of this problem?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 19 Feb 2004 19:05:41 -0800
Karl Heinz Buchegger wrote:
>> ...
>> Even if he was memsetting Date he's likely to get into problems. The
>> idiom of initializing by memsetting C type structures seems to a MS
>> thing, which doesn't work with C++ structs and classes where you are
>> likely to zap the vtable pointer.
>
> true.
> But the OP used a POD struct.
> memsetting to 0 should not be a problem in this case.
> ...
No, it is still a problem. You must be thinking about 'memcpy', not
about 'memset'. Strictly speaking, 'memset' cannot be used to
zero-initialize 'int' objects. And 'int' objects is exactly what the OP
is storing in his/her POD struct called 'date_struct'.
-- Best regards, Andrey Tarasevich
- Next message: Phlip: "Re: return const and assert"
- Previous message: Andrey Tarasevich: "Re: Anyone knows what can be cause of this problem?"
- In reply to: Karl Heinz Buchegger: "Re: Anyone knows what can be cause of this problem?"
- Next in thread: Rob Williscroft: "Re: Anyone knows what can be cause of this problem?"
- Reply: Rob Williscroft: "Re: Anyone knows what can be cause of this problem?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]