Click here to Skip to main content
16,005,178 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: side by side configration error Pin
VCProgrammer23-Sep-08 0:07
VCProgrammer23-Sep-08 0:07 
GeneralRe: side by side configration error Pin
Rajesh R Subramanian23-Sep-08 0:08
professionalRajesh R Subramanian23-Sep-08 0:08 
GeneralRe: side by side configration error Pin
VCProgrammer23-Sep-08 0:14
VCProgrammer23-Sep-08 0:14 
GeneralRe: side by side configration error Pin
Rajesh R Subramanian23-Sep-08 0:18
professionalRajesh R Subramanian23-Sep-08 0:18 
AnswerRe: side by side configration error Pin
KarstenK23-Sep-08 2:33
mveKarstenK23-Sep-08 2:33 
QuestionVariable scoping and pointers Pin
Christian Flutcher22-Sep-08 23:42
Christian Flutcher22-Sep-08 23:42 
AnswerRe: Variable scoping and pointers Pin
Russell'22-Sep-08 23:50
Russell'22-Sep-08 23:50 
AnswerRe: Variable scoping and pointers Pin
Cedric Moonen22-Sep-08 23:50
Cedric Moonen22-Sep-08 23:50 
Christian Flutcher wrote:
I am confused how this is happening?


Because you were lucky (or in your case, not Smile | :) ). In your ChangeData function, your local variable has a certain address which you store in your ptr variable. When the function exits, your ptr variable still holds the same address but as you said, the variable has been 'removed' from the stack. But remove simply means that this memory can be used for other purposes, which in your case you don't so the memory is not overwritten (and still containing the same value). If now you would do other things before printing the value, chances are that it will not work anymore.

Cédric Moonen
Software developer

Charting control [v1.5]
OpenGL game tutorial in C++

GeneralRe: Variable scoping and pointers Pin
Christian Flutcher22-Sep-08 23:58
Christian Flutcher22-Sep-08 23:58 
AnswerRe: Variable scoping and pointers Pin
Rajesh R Subramanian22-Sep-08 23:55
professionalRajesh R Subramanian22-Sep-08 23:55 
GeneralRe: Variable scoping and pointers Pin
Christian Flutcher23-Sep-08 0:08
Christian Flutcher23-Sep-08 0:08 
AnswerRe: Variable scoping and pointers Pin
Rajesh R Subramanian23-Sep-08 0:58
professionalRajesh R Subramanian23-Sep-08 0:58 
GeneralRe: Variable scoping and pointers Pin
Christian Flutcher23-Sep-08 1:05
Christian Flutcher23-Sep-08 1:05 
GeneralRe: Variable scoping and pointers Pin
Cedric Moonen23-Sep-08 1:26
Cedric Moonen23-Sep-08 1:26 
GeneralRe: Variable scoping and pointers Pin
Rajesh R Subramanian23-Sep-08 1:35
professionalRajesh R Subramanian23-Sep-08 1:35 
QuestionAudio Capturing for RTP - Windows Pin
CrazyDogg22-Sep-08 23:29
CrazyDogg22-Sep-08 23:29 
AnswerRe: Audio Capturing for RTP - Windows Pin
Mark Salsbery23-Sep-08 10:24
Mark Salsbery23-Sep-08 10:24 
GeneralRe: Audio Capturing for RTP - Windows [modified] Pin
CrazyDogg23-Sep-08 21:26
CrazyDogg23-Sep-08 21:26 
GeneralRe: Audio Capturing for RTP - Windows Pin
Mark Salsbery24-Sep-08 5:44
Mark Salsbery24-Sep-08 5:44 
AnswerRe: Audio Capturing for RTP - Windows Pin
Mark Salsbery23-Sep-08 10:27
Mark Salsbery23-Sep-08 10:27 
QuestionGetting number of channels from a WMV Pin
Ben.Robinson.2322-Sep-08 23:19
Ben.Robinson.2322-Sep-08 23:19 
AnswerRe: Getting number of channels from a WMV Pin
Mark Salsbery23-Sep-08 10:33
Mark Salsbery23-Sep-08 10:33 
QuestionScrollbars are not working in VISTA Pin
hari_honey22-Sep-08 23:08
hari_honey22-Sep-08 23:08 
QuestionRe: Scrollbars are not working in VISTA Pin
Mark Salsbery23-Sep-08 10:37
Mark Salsbery23-Sep-08 10:37 
QuestionMaking a static labrary (to use <...> insted of "...") Pin
akirilov22-Sep-08 23:02
akirilov22-Sep-08 23:02 

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.