0
sareen's Avatar, Join Date: Feb 2008
Go4Expert Member
nice
0
sareen's Avatar, Join Date: Feb 2008
Go4Expert Member
sir very easy program
0
asadullah.ansari's Avatar, Join Date: Jan 2008
TechCake
Quote:
Originally Posted by donakalz
Thanks man for the very very nice code.

However, I am trying to create a version which works for C++ operators new and delete like this:

#define new (elemSize) MyNew (elemSize, __FILE__, __LINE__)
#define new [](elemSize) MyNewArray (elemSize, __FILE__, __LINE__)
#define delete(memPointer) MyDelete (memPointer)
#define delete [](memPointer) MyDeleteArray (memPointer)

and I get the following compiler errors:
24:1 [Warning] "new" redefined
26:1 [Warning] "delete" redefined


Can you think of a workaround for this? Thanks.

Don
How it will happen? Are You sure about this warning? Because I am using Flexlint tools for making zero warning also.
By any way can you give at which plateform and compiler you are using ?
0
donakalz's Avatar, Join Date: Mar 2008
Newbie Member
I use windows xp and a DevC++ compiler. I get the error that new and delete are redefined. I also get the error with Netbeans 6.1 for C++. Maybe you could post some code of yours to show how you accomplished this task. Thanks.

don
0
asadullah.ansari's Avatar, Join Date: Jan 2008
TechCake
Quote:
Originally Posted by donakalz
I use windows xp and a DevC++ compiler. I get the error that new and delete are redefined. I also get the error with Netbeans 6.1 for C++. Maybe you could post some code of yours to show how you accomplished this task. Thanks.

don
I dont know how you are using. Have you some sense. Any compiler is not mad like you. How it will give redefined. I have define as macro. Do you have some skill. If you have some little bit skill then it will run.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Nomination for article of the month of March
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Vote here - Voting for article of the month for Mar 2008
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Winner of article of the month for Mar 2008
0
saroj.pandarkl's Avatar, Join Date: Jun 2008
Newbie Member
Hi
Aa I saw through this forum many people are asking basic question what is memory leak and they are advised to go through google.Can any do a little favour like when creating any variable or ointer things in which area of memory it stores(i mean to say like code segment ,data seg etc).Explanation (undestanding)required on it before going about memory leak
0
inkuar.ikkr's Avatar, Join Date: Jun 2008
Newbie Member
Hello asadullah,

Could you please send the findleak program for C++ for New, Delete .. methods?

Thanks,
INDRA