* red floyd:
> On Feb 2, 4:24 pm, Jorgen Grahn <grahn+n...@snipabacken.se> wrote:
>> On Mon, 2010-01-25, Larry wrote:
>
>>> ZeroMemory(buff, sizeof(Buffer));
>> Just out of curiosity: did you define this one somewhere, or are
>> Microsoft daft enough to push a differently named std::memset()?
>
> Microsoft is that daft.
I agree

, but in this particular case it's not so. ZeroMemory is a Windows
API function. It's available whether you program in C or Pascal or Fortran, say
(actually I don't know about Fortran, it's near 30 years since I last rode that
beast, but I'm pretty sure it can be used also from Fortran).
The OP's code was
Buffer *buff = new Buffer;
ZeroMemory(buff, sizeof(Buffer));
and by the rules of C++ he could just have written
Buffer* buff = new Buffer(); // That's it.
by §5.3.4/15 second main dash, which in C++98 reads "If the new-initializer is
of the form (), default-initialization shall be performed" (and I guess that's
changed to "value initialization" in C++03, but I'm not checking that).
Cheers,
- Alf