Go4Expert Member
25Mar2008,15:39   #31
sareen's Avatar
nice
Go4Expert Member
25Mar2008,15:44   #32
sareen's Avatar
sir very easy program
TechCake
26Mar2008,14:55   #33
asadullah.ansari's Avatar
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 ?
Newbie Member
27Mar2008,04:11   #34
donakalz's Avatar
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
TechCake
28Mar2008,10:40   #35
asadullah.ansari's Avatar
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.
Go4Expert Founder
4Apr2008,18:45   #36
shabbir's Avatar
Nomination for article of the month of March
Go4Expert Founder
17Apr2008,15:51   #37
shabbir's Avatar
Vote here - Voting for article of the month for Mar 2008
Go4Expert Founder
30Apr2008,12:00   #38
shabbir's Avatar
Winner of article of the month for Mar 2008
Newbie Member
21Jun2008,16:16   #39
saroj.pandarkl's Avatar
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
Newbie Member
24Jun2008,22:31   #40
inkuar.ikkr's Avatar
Hello asadullah,

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

Thanks,
INDRA