|
From: Daniel G. <sp...@ho...> - 2002-05-16 08:19:40
|
I think that memory can be deallocated using free at any time so long as you have char* still around. So I'm assuming in your function (method) you have char* pX; pX malloc(whatever) ((I do C++)) return pX; you can use pX in the main() function to deallocate with free. >From: "J Miller" <jm...@we...> >Reply-To: <jm...@we...> >To: "Dev-C++ Users \(E-mail\)" <dev...@li...> >Subject: [Dev-C++] Generic C++ question. >Date: Thu, 16 May 2002 10:32:35 +0930 > >Hi all, > >If a method returns a char pointer (char*). > >If the above method does a malloc() to allocate memory >for some text (or something) and then fills that memory. > >The char* is returned to the user code. > >Who (or which code) is responsible for doing a free() on the char*? > >John M' > >_______________________________________________________________ > >Have big pipes? SourceForge.net is looking for download mirrors. We supply >the hardware. You get the recognition. Email Us: ban...@so... >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com |