Re: how to delete this?

From: Gernot Frisch (Me_at_Privacy.net)
Date: 07/26/04


Date: Mon, 26 Jul 2004 11:25:32 +0200


"Kyle" <zhouzhendong@hotmail.com> schrieb im Newsbeitrag
news:4104cc86@dnews.tpgi.com.au...
> I have the following codes
>
> int (*p)[2];
> p=new int [4][2];
> ...
> delete [] p;
>
> is the way to free the memory correct?

Yep. delete [] p; p=NULL; // indicate it's invalid!

-- 
-Gernot
int main(int argc, char** argv) {printf
("%silto%c%cf%cgl%ssic%ccom%c", "ma", 58, 'g', 64, "ba", 46, 10);}
________________________________________
Looking for a good game? Do it yourself!
GLBasic - you can do
www.GLBasic.com


Relevant Pages

  • fast web search?
    ... int main(int argc, char** argv) {printf ... Looking for a good game? ...
    (alt.php)
  • vsync
    ... int main(int argc, char** argv) {printf ... Looking for a good game? ...
    (microsoft.public.windowsce.embedded.vc)
  • posting as is
    ... int main(int argc, char** argv) {printf ... Looking for a good game? ...
    (alt.php)
  • ifstream - nocreate - how to?
    ... int main(int argc, char** argv) {printf ... Looking for a good game? ...
    (comp.lang.cpp)
  • vsync?
    ... int main(int argc, char** argv) {printf ... Looking for a good game? ...
    (microsoft.public.pocketpc.developer)