At about the time of 2/20/2007 8:31 PM, madhawi stated the following:
Please don't top-post.
I am asking in C++. I use my application on Window2000.
Ian Collins wrote:
>madhawi wrote:
>>i am using c++. i used delete and destructor to free the memory. can u
help me this in c++, please.
u doesn't post here any more.
Sounds like you should either be asking on a C++ or Linux programming group.
--
Ian Collins.
This group is C only, not C++, not Apple C, not coca, not PL1, fortran,
pascal, or anything else. C only. Since your question is a C++
question, post your question in comp.lang.c++ instead of here.
As for Windows 2K, you'll need to post in one of the
comp.os.ms-windows.programmer groups, or another group that supports
your platform. You may also try one of Microsoft's programming forums
on their developer's network (requires subscription though).
As for a memory leak, the best way to avoid it is for every call to
malloc that you make, there should also be a corresponding free
statement. If you destroy the contents of a pointer before calling
free, then that memory remains allocated but unaccessible since you no
longer know where it is. So as your program keeps executing the same
piece of code, the memory usage will get larger and larger until you
eventually run out. What happens then is implementation specific.
I do know that on some implementations if you call free twice, you will
get a warning (mainly on the unix style platforms). But, IIRC, call
free on a block of memory that is already free results in undefined
behavior.
--
Daniel Rudy
Email address has been base64 encoded to reduce spam
Decode email address using b64decode or uudecode -m
Why geeks like computers: look chat date touch grep make unzip
strip view finger mount fcsk more fcsk yes spray umount sleep