Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!uunet!mcsun!hp4nl!ruuinf!prisma!ger From: ger@prisma.cv.ruu.nl (Ger Timmens) Newsgroups: comp.lang.c++ Subject: deleting allocated memory Message-ID: Date: 12 Aug 90 13:34:39 GMT Distribution: comp.lang.c++ Organization: University of Utrecht, 3D Computer Vision The Netherlands Lines: 21 When I allocate temporary memory in a function, like this: double padTempArray = new double [100]; do I have to delete this before I return from this function ? I believe this is done automatically when the function goes out of scope. If so, should I delete it manually or let the compiler do the work ? Thanks, +===========================================================+ | Ger Timmens, 3 Dimensional Computer Vision Research Group | + Academical Hospital Utrecht, Heidelberglaan 100 + + 3584 CX Utrecht, THE NETHERLANDS, e-mail: ger@cv.ruu.nl + | Tel.No.: +31-30-506711, Fax.No.: +31-30-513399 | +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+ | Delft, Universiry of Technology | + Faculty of Technical Mathematics and Informatics + | Section of Applied Analysis | +===========================================================+