Click here to Skip to main content
15,923,789 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CStatic problem Pin
Michael Dunn15-Oct-01 12:34
sitebuilderMichael Dunn15-Oct-01 12:34 
Questionnew and delete, why does this work? Pin
Sam C15-Oct-01 10:22
Sam C15-Oct-01 10:22 
AnswerRe: new and delete, why does this work? Pin
Tim Smith15-Oct-01 10:27
Tim Smith15-Oct-01 10:27 
GeneralRe: new and delete, why does this work? Pin
Sam C15-Oct-01 11:54
Sam C15-Oct-01 11:54 
AnswerRe: new and delete, why does this work? Pin
Tomasz Sowinski15-Oct-01 10:28
Tomasz Sowinski15-Oct-01 10:28 
GeneralRe: new and delete, why does this work? Pin
Sam C15-Oct-01 11:52
Sam C15-Oct-01 11:52 
GeneralRe: new and delete, why does this work? Pin
Mike Burston15-Oct-01 12:29
Mike Burston15-Oct-01 12:29 
GeneralRe: new and delete, why does this work? Pin
PJ Arends15-Oct-01 13:07
professionalPJ Arends15-Oct-01 13:07 
I think the easy way to get your head around pointers is to think of them as addresses. the RAM (memory) is a street, and every house on that street has an address (a pointer). If you want to tell your friend to go to a certain house, you write the address on a piece of paper, and you give him the paper (you have just passed a pointer, in a customstruct(on paper)), then he goes out and meets another friend, who also wants the addresses that he writes in his notebook (gets a copy of the pointer). Now your friend decides he doesn't need the address any more so he throws away the paper (deletes the custom struct, but the memory(house) still exists). As long as the house exists the address is valid, but if the house burns down (your object is deleted from memory) the address will point to an empty lot (invalid memory).
I hope this helps, this analogy helped me understand pointersSmile | :)

---
Blessed are those who can laugh at themselves, for they shall never cease to be amused Laugh | :laugh:
GeneralRe: new and delete, why does this work? Pin
Sam C15-Oct-01 13:46
Sam C15-Oct-01 13:46 
AnswerRe: new and delete, why does this work? Pin
Sam C15-Oct-01 13:48
Sam C15-Oct-01 13:48 
GeneralATL Pin
mimi15-Oct-01 9:13
mimi15-Oct-01 9:13 
GeneralCArray "How to" Pin
RobJones15-Oct-01 7:23
RobJones15-Oct-01 7:23 
GeneralRe: CArray "How to" Pin
Carlos Antollini15-Oct-01 7:38
Carlos Antollini15-Oct-01 7:38 
GeneralRe: CArray "How to" Pin
RobJones15-Oct-01 7:55
RobJones15-Oct-01 7:55 
GeneralRe: CArray "How to" Pin
Carlos Antollini15-Oct-01 8:22
Carlos Antollini15-Oct-01 8:22 
GeneralRe: CArray "How to" Pin
Carlos Antollini15-Oct-01 8:40
Carlos Antollini15-Oct-01 8:40 
GeneralRe: CArray "How to" Pin
RobJones15-Oct-01 9:20
RobJones15-Oct-01 9:20 
GeneralRe: CArray "How to" Pin
Christian Graus15-Oct-01 10:29
protectorChristian Graus15-Oct-01 10:29 
GeneralRe: CArray "How to" Pin
RobJones15-Oct-01 11:15
RobJones15-Oct-01 11:15 
GeneralRe: CArray "How to" Pin
Christian Graus15-Oct-01 11:34
protectorChristian Graus15-Oct-01 11:34 
GeneralRe: CArray "How to" Pin
Mike Burston15-Oct-01 11:57
Mike Burston15-Oct-01 11:57 
GeneralHelp: Software Distribution in Visual C++ Pin
Agusti15-Oct-01 6:37
Agusti15-Oct-01 6:37 
GeneralRe: Help: Software Distribution in Visual C++ Pin
Carlos Antollini15-Oct-01 6:44
Carlos Antollini15-Oct-01 6:44 
GeneralMFC Extension DLL and Automation support Pin
Paul Selormey15-Oct-01 5:39
Paul Selormey15-Oct-01 5:39 
GeneralPARSING of Command Line Arguments Pin
15-Oct-01 5:23
suss15-Oct-01 5:23 

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.