Re: ATL/COM memory management

From: Sergei (sergei_at_nospam.summertime.mtu-net.ru)
Date: 06/28/04


Date: Mon, 28 Jun 2004 13:38:26 +0400


"Arnaud Debaene" <adebaene@club-internet.fr> wrote in message news:16a4a8c7.0405100717.609dce02@posting.google.com...
> "Sergei" <sergei@nospam.summertime.mtu-net.ru> wrote in message news:<ueCJ7GDNEHA.2876@TK2MSFTNGP09.phx.gbl>...
> > "Simon Trew" <noneofyour@business.guv> wrote in message news:Oz9p3rANEHA.2996@TK2MSFTNGP12.phx.gbl...
> > > If you allocate with new then deallocate with delete.
> >
> > An array must be deallocated with delete []
> > Even if allocated with new.
> How do you allocate an array with new (not new[]) ?

typedef char array[10];
char *ptr = new array;
delete [] ptr;

Sergei

And how does it happen that using Microsoft's news client I post
to Microsoft's news server, it doesn't report any problems with
the posting, yet the posting never appears on the server?

> Arnaud
> MVP - VC



Relevant Pages

  • conditional operator again
    ... I am posting what I exactly ... My objective is to convert a function func() to macro for efficiency. ... func2(var, ptr); ...
    (comp.lang.c)
  • Re: explanation needed on const pointers
    ... const char *ptr; ... char *const* ptr; ... What is the best way to reference a previous posting? ... looks horrible and I can't from the style is the URI in long-lived or ...
    (comp.lang.c)