Click here to Skip to main content
15,911,715 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: File handaling problem Pin
Davitor2-Mar-09 6:42
Davitor2-Mar-09 6:42 
GeneralRe: File handaling problem Pin
Eytukan2-Mar-09 6:56
Eytukan2-Mar-09 6:56 
GeneralRe: File handaling problem Pin
Ric Ashton2-Mar-09 6:59
Ric Ashton2-Mar-09 6:59 
GeneralRe: File handaling problem Pin
Richard Andrew x642-Mar-09 7:44
professionalRichard Andrew x642-Mar-09 7:44 
AnswerRe: File handaling problem Pin
Maximilien2-Mar-09 6:53
Maximilien2-Mar-09 6:53 
GeneralRe: File handaling problem Pin
Davitor2-Mar-09 7:05
Davitor2-Mar-09 7:05 
GeneralRe: File handaling problem Pin
Maximilien2-Mar-09 7:16
Maximilien2-Mar-09 7:16 
AnswerRe: File handaling problem Pin
David Crow2-Mar-09 9:01
David Crow2-Mar-09 9:01 
QuestionConstructor / Destructor Question Pin
Richard Andrew x642-Mar-09 5:15
professionalRichard Andrew x642-Mar-09 5:15 
AnswerRe: Constructor / Destructor Question Pin
«_Superman_»2-Mar-09 5:31
professional«_Superman_»2-Mar-09 5:31 
GeneralRe: Constructor / Destructor Question Pin
Richard Andrew x642-Mar-09 6:10
professionalRichard Andrew x642-Mar-09 6:10 
GeneralRe: Constructor / Destructor Question Pin
Eytukan2-Mar-09 6:42
Eytukan2-Mar-09 6:42 
GeneralRe: Constructor / Destructor Question Pin
Perisic, Aleksandar2-Mar-09 7:37
Perisic, Aleksandar2-Mar-09 7:37 
GeneralRe: Constructor / Destructor Question Pin
Richard Andrew x642-Mar-09 7:39
professionalRichard Andrew x642-Mar-09 7:39 
GeneralRe: Constructor / Destructor Question Pin
Eytukan2-Mar-09 19:34
Eytukan2-Mar-09 19:34 
GeneralRe: Constructor / Destructor Question Pin
Eytukan2-Mar-09 19:32
Eytukan2-Mar-09 19:32 
GeneralRe: Constructor / Destructor Question Pin
Perisic, Aleksandar2-Mar-09 19:54
Perisic, Aleksandar2-Mar-09 19:54 
GeneralRe: Constructor / Destructor Question Pin
Eytukan2-Mar-09 20:03
Eytukan2-Mar-09 20:03 
GeneralRe: Constructor / Destructor Question Pin
Richard Andrew x642-Mar-09 7:38
professionalRichard Andrew x642-Mar-09 7:38 
GeneralRe: Constructor / Destructor Question Pin
Eytukan2-Mar-09 19:46
Eytukan2-Mar-09 19:46 
AnswerRe: Constructor / Destructor Question Pin
Perisic, Aleksandar2-Mar-09 5:38
Perisic, Aleksandar2-Mar-09 5:38 
QuestionNeed help on CDateTimeCtrl class Pin
John5022-Mar-09 4:25
John5022-Mar-09 4:25 
AnswerRe: Need help on CDateTimeCtrl class Pin
Perisic, Aleksandar2-Mar-09 6:14
Perisic, Aleksandar2-Mar-09 6:14 
GeneralRe: Need help on CDateTimeCtrl class Pin
John5022-Mar-09 6:57
John5022-Mar-09 6:57 
QuestionPointer Pin
dehseth2-Mar-09 4:25
dehseth2-Mar-09 4:25 
Hey ppl,

I have two pointers and one value:

int* p1 = new int;
*p1 = 10;

int *p2;
p2 = p1;


Now p1 and p2 has different addresses (of course). They both points the same unnamed integer value. Lets delete p1:

delete p1;
p1 = NULL;


Now p1 is NULL and referenced the only integer is deleted. Now if I try

delete p2;
p2 = NULL;


Just crashes cause int which is referenced by p2 is not valid anymore.

So how can I check if int is still valid OR maybe make p2 = NULL when object is deleted.. I read about shared pointers with templated which are not good for me to use right now?

Any workarounds?

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.