Click here to Skip to main content
15,879,535 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Managing PushButton notifications under MFC Pin
Richard MacCutchan27-Jul-11 3:19
mveRichard MacCutchan27-Jul-11 3:19 
GeneralRe: Managing PushButton notifications under MFC Pin
tiwal27-Jul-11 3:23
tiwal27-Jul-11 3:23 
GeneralRe: Managing PushButton notifications under MFC Pin
Richard MacCutchan27-Jul-11 3:29
mveRichard MacCutchan27-Jul-11 3:29 
AnswerRe: Managing PushButton notifications under MFC Pin
Madhu Nair26-Jul-11 23:35
Madhu Nair26-Jul-11 23:35 
GeneralRe: Managing PushButton notifications under MFC [modified] Pin
tiwal26-Jul-11 23:46
tiwal26-Jul-11 23:46 
QuestionHow to compile a file using unicode charset Pin
Cold_Fearing_Bird26-Jul-11 21:50
Cold_Fearing_Bird26-Jul-11 21:50 
AnswerRe: How to compile a file using unicode charset Pin
Madhu Nair26-Jul-11 22:01
Madhu Nair26-Jul-11 22:01 
QuestionDelete doesn't ^delete^ a reference? Pin
Dean Seo25-Jul-11 20:58
Dean Seo25-Jul-11 20:58 
Hi,

I just found that the keyword Delete doesn't mean ^delete^ the way we(or maybe just I) normally think it does.

I thought if you delete a reference, the reference is deleted right after the delete and to have NULL value, which is not so true.

Let me show you an example.

--------------------------------------------
#include <iostream>
class test
{
public:
char ch;
~test() { printf("End!\n"); }
};

class test2
{
public:
char ch2;
~test2() { printf("End!\n"); }
};

int main()
{
test* callFunc = new test();
callFunc ->ch = 'a';

delete callFunc;

test2* callFunc2 = new test2();
printf("%p %p\n",(void*)callFunc,(void*)callFunc2);
callFunc2 -> ch2 = 'b';

printf("%c %c \n",callFunc ->ch ,callFunc2 -> ch2);
}


End!
0395BA8 0395BA8
b b
--------------------------------------------

From this result, I want to theorize that the keyword Delete is just to let the references that you delete be available to be pasted later.

I'd like to know if my idea is correct or if there are some other reasons for this?

Thanks in advance.
AnswerRe: Delete doesn't ^delete^ a reference? Pin
Richard MacCutchan25-Jul-11 21:24
mveRichard MacCutchan25-Jul-11 21:24 
GeneralRe: Delete doesn't ^delete^ a reference? Pin
Dean Seo26-Jul-11 14:11
Dean Seo26-Jul-11 14:11 
AnswerRe: Delete doesn't ^delete^ a reference? Pin
Chris Losinger26-Jul-11 1:45
professionalChris Losinger26-Jul-11 1:45 
GeneralRe: Delete doesn't ^delete^ a reference? Pin
Dean Seo26-Jul-11 14:10
Dean Seo26-Jul-11 14:10 
AnswerRe: Delete doesn't ^delete^ a reference? Pin
jschell26-Jul-11 9:48
jschell26-Jul-11 9:48 
GeneralRe: Delete doesn't ^delete^ a reference? Pin
Dean Seo26-Jul-11 14:09
Dean Seo26-Jul-11 14:09 
AnswerRe: Delete doesn't ^delete^ a reference? Pin
Stefan_Lang27-Jul-11 3:00
Stefan_Lang27-Jul-11 3:00 
GeneralRe: Delete doesn't ^delete^ a reference? Pin
jschell27-Jul-11 12:32
jschell27-Jul-11 12:32 
QuestionWorking with XML file in MFC Dialog based application? Pin
Le@rner25-Jul-11 20:27
Le@rner25-Jul-11 20:27 
AnswerRe: Working with XML file in MFC Dialog based application? Pin
Rajesh R Subramanian25-Jul-11 20:31
professionalRajesh R Subramanian25-Jul-11 20:31 
GeneralRe: Working with XML file in MFC Dialog based application? Pin
Le@rner25-Jul-11 21:02
Le@rner25-Jul-11 21:02 
GeneralRe: Working with XML file in MFC Dialog based application? Pin
Richard MacCutchan25-Jul-11 21:14
mveRichard MacCutchan25-Jul-11 21:14 
AnswerRe: Working with XML file in MFC Dialog based application? Pin
David Crow26-Jul-11 5:11
David Crow26-Jul-11 5:11 
GeneralRe: Working with XML file in MFC Dialog based application? Pin
Le@rner26-Jul-11 19:03
Le@rner26-Jul-11 19:03 
GeneralRe: Working with XML file in MFC Dialog based application? Pin
Rolf Kristensen27-Jul-11 12:05
Rolf Kristensen27-Jul-11 12:05 
QuestionDoes "parasoft c++ test" support VS2008? Pin
Cold_Fearing_Bird25-Jul-11 19:05
Cold_Fearing_Bird25-Jul-11 19:05 
AnswerRe: Does "parasoft c++ test" support VS2008? Pin
Code-o-mat25-Jul-11 22:07
Code-o-mat25-Jul-11 22:07 

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.