Click here to Skip to main content
16,012,061 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Class wizard problem Pin
nguyenvhn5-Sep-05 22:18
nguyenvhn5-Sep-05 22:18 
AnswerRe: Class wizard problem Pin
heavenode5-Sep-05 22:24
heavenode5-Sep-05 22:24 
QuestionText data conversion into different file formats Pin
Member 3618575-Sep-05 18:49
Member 3618575-Sep-05 18:49 
QuestionHelp, error when deleting m_p in destructor. Pin
followait5-Sep-05 18:49
followait5-Sep-05 18:49 
AnswerRe: Help, error when deleting m_p in destructor. Pin
khan++5-Sep-05 19:03
khan++5-Sep-05 19:03 
GeneralIt's my careless, it should be delete[] p, but still have a error. Pin
followait5-Sep-05 19:33
followait5-Sep-05 19:33 
GeneralRe: It's my careless, it should be delete[] p, but still have a error. Pin
Jose Lamas Rios5-Sep-05 19:50
Jose Lamas Rios5-Sep-05 19:50 
AnswerRe: Help, error when deleting m_p in destructor. Pin
MailtoGops5-Sep-05 21:57
MailtoGops5-Sep-05 21:57 
Hi,


int k=123;
stTst *p=new stTst[10];
p->p=&k;
delete[] p;


look k is allocated in the stack memory of the function OnButton1(). You are assigning the address of k to a class member variable and deleting it through dynamic deletion option. You can do that.

You cannot dynamically delete a variable which is allocated in the stack.



So you supposed not to delete the

" Action without vision is only passing time,
Vision without action is merely day dreaming,
But vision with action can change the world "

- Words from Nelson Mandela

Thanks & Regards,

Gopalakrishnan
AnswerThanks. Pin
followait5-Sep-05 22:56
followait5-Sep-05 22:56 
QuestionLPT Port programming in Win32(sdk) Pin
rohanr2p5-Sep-05 18:31
rohanr2p5-Sep-05 18:31 
AnswerRe: LPT Port programming in Win32(sdk) Pin
khan++5-Sep-05 18:57
khan++5-Sep-05 18:57 
Questionhow to install windows NT services Pin
GflPower5-Sep-05 18:24
GflPower5-Sep-05 18:24 
AnswerRe: how to install windows NT services Pin
GflPower5-Sep-05 18:42
GflPower5-Sep-05 18:42 
AnswerRe: how to install windows NT services Pin
prasad_som5-Sep-05 19:14
prasad_som5-Sep-05 19:14 
AnswerRe: how to install windows NT services Pin
ThatsAlok5-Sep-05 23:30
ThatsAlok5-Sep-05 23:30 
GeneralRe: how to install windows NT services Pin
prasad_som14-Sep-05 22:29
prasad_som14-Sep-05 22:29 
AnswerRe: how to install windows NT services Pin
ThatsAlok14-Sep-05 22:44
ThatsAlok14-Sep-05 22:44 
GeneralRe: how to install windows NT services Pin
ThatsAlok6-Sep-05 0:59
ThatsAlok6-Sep-05 0:59 
AnswerRe: how to install windows NT services Pin
Marc Soleda5-Sep-05 20:44
Marc Soleda5-Sep-05 20:44 
QuestionMDI MFC App Question Pin
LighthouseJ5-Sep-05 17:22
LighthouseJ5-Sep-05 17:22 
AnswerRe: MDI MFC App Question Pin
MailtoGops5-Sep-05 22:07
MailtoGops5-Sep-05 22:07 
QuestionAbout Dialog bar size Pin
zhaopi5-Sep-05 17:17
zhaopi5-Sep-05 17:17 
Questionserver and client Pin
Member 21610045-Sep-05 16:00
Member 21610045-Sep-05 16:00 
AnswerRe: server and client Pin
Christian Graus5-Sep-05 16:04
protectorChristian Graus5-Sep-05 16:04 
GeneralRe: server and client Pin
Moak6-Sep-05 1:18
Moak6-Sep-05 1:18 

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.