Click here to Skip to main content
15,894,250 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: memory leak!!!!!! Pin
namaskaaram14-Feb-06 18:42
namaskaaram14-Feb-06 18:42 
AnswerRe: memory leak!!!!!! Pin
Stephen Hewitt14-Feb-06 18:55
Stephen Hewitt14-Feb-06 18:55 
AnswerRe: memory leak!!!!!! Pin
Ashutosh_shashi14-Feb-06 19:20
Ashutosh_shashi14-Feb-06 19:20 
GeneralRe: memory leak!!!!!! Pin
namaskaaram14-Feb-06 19:42
namaskaaram14-Feb-06 19:42 
GeneralRe: memory leak!!!!!! Pin
Ryan Binns14-Feb-06 19:51
Ryan Binns14-Feb-06 19:51 
GeneralRe: memory leak!!!!!! Pin
BadKarma14-Feb-06 20:29
BadKarma14-Feb-06 20:29 
GeneralRe: memory leak!!!!!! Pin
Ryan Binns14-Feb-06 21:27
Ryan Binns14-Feb-06 21:27 
GeneralRe: memory leak!!!!!! Pin
BadKarma14-Feb-06 21:43
BadKarma14-Feb-06 21:43 
I know,

I was just trying to point out for naguu that altough setting a pointer to NULL and then deleting wont cause an error it will cause a memory leak. Which was (one of) his first problems.

To conclude:
char * getmestring()
{
char *str = new char[20];

// FROM <a href = "http://www.codeproject.com/script/comments/forums.asp?msg=1371347&forumid=1647#xx1371359xx" rel="nofollow">Stephen Hewitt</a>[<a href = "http://www.codeproject.com/script/comments/forums.asp?msg=1371347&forumid=1647#xx1371359xx" target = "_blank" rel="nofollow">^</a>]
// str = "myname";
strcpy(str, "myname"); 
return str;
}
int main()
{

// FROM <a href = "http://www.codeproject.com/script/comments/forums.asp?msg=1371347&forumid=1647#xx1371347xx" rel="nofollow">namaskaaram</a>[<a href = "http://www.codeproject.com/script/comments/forums.asp?msg=1371347&forumid=1647#xx1371347xx" target = "_blank" rel="nofollow">^</a>]
//char name = getmestring();
char *name = getmestring(); 
cout<<name<<endl;
if(name != NULL)
{
delete [] name; 
}
}


codito ergo sum
GeneralRe: memory leak!!!!!! Pin
Ryan Binns14-Feb-06 21:48
Ryan Binns14-Feb-06 21:48 
GeneralRe: memory leak!!!!!! Pin
namaskaaram14-Feb-06 21:34
namaskaaram14-Feb-06 21:34 
GeneralRe: memory leak!!!!!! Pin
Ryan Binns14-Feb-06 21:44
Ryan Binns14-Feb-06 21:44 
GeneralRe: memory leak!!!!!! Pin
Ashutosh_shashi14-Feb-06 21:18
Ashutosh_shashi14-Feb-06 21:18 
GeneralRe: memory leak!!!!!! Pin
ThatsAlok14-Feb-06 23:11
ThatsAlok14-Feb-06 23:11 
QuestionRe: memory leak!!!!!! Pin
David Crow15-Feb-06 4:15
David Crow15-Feb-06 4:15 
QuestionEncryption Pin
Tony Kurishunkal14-Feb-06 17:41
Tony Kurishunkal14-Feb-06 17:41 
AnswerRe: Encryption Pin
namaskaaram14-Feb-06 18:46
namaskaaram14-Feb-06 18:46 
AnswerRe: Encryption Pin
moodsey21114-Feb-06 19:22
moodsey21114-Feb-06 19:22 
QuestionApplication crashed on client side not on my side Pin
zahid_ash14-Feb-06 17:34
zahid_ash14-Feb-06 17:34 
AnswerRe: Application crashed on client side not on my side Pin
Ashutosh_shashi14-Feb-06 19:30
Ashutosh_shashi14-Feb-06 19:30 
AnswerRe: Application crashed on client side not on my side Pin
kakan14-Feb-06 20:40
professionalkakan14-Feb-06 20:40 
QuestionShared data, functions across DLL Pin
arunperi14-Feb-06 17:22
arunperi14-Feb-06 17:22 
AnswerRe: Shared data, functions across DLL Pin
Ryan Binns14-Feb-06 17:39
Ryan Binns14-Feb-06 17:39 
GeneralRe: Shared data, functions across DLL Pin
arunperi14-Feb-06 17:45
arunperi14-Feb-06 17:45 
GeneralRe: Shared data, functions across DLL Pin
Ryan Binns14-Feb-06 21:29
Ryan Binns14-Feb-06 21:29 
AnswerRe: Shared data, functions across DLL Pin
Naveen14-Feb-06 17:44
Naveen14-Feb-06 17:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.