Click here to Skip to main content
15,893,337 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Add User Pin
Programm3r25-Oct-06 4:10
Programm3r25-Oct-06 4:10 
QuestionRe: Add User Pin
David Crow25-Oct-06 5:45
David Crow25-Oct-06 5:45 
GeneralRe: Add User Pin
Anilkumar K V25-Oct-06 20:13
Anilkumar K V25-Oct-06 20:13 
Questionscope in functions Pin
minkowski25-Oct-06 0:32
minkowski25-Oct-06 0:32 
AnswerRe: scope in functions Pin
toxcct25-Oct-06 0:40
toxcct25-Oct-06 0:40 
GeneralRe: scope in functions Pin
minkowski25-Oct-06 0:56
minkowski25-Oct-06 0:56 
GeneralRe: scope in functions Pin
benjymous25-Oct-06 1:14
benjymous25-Oct-06 1:14 
AnswerRe: scope in functions Pin
Tim Paaschen25-Oct-06 0:46
Tim Paaschen25-Oct-06 0:46 
Hi,

minkowski wrote:
I would have thought that as you leave create(), marks goes out of scope

This is correct.

minkowski wrote:
therefore you destroy the object

marks is just an integer, there is not much to destroy.

minkowski wrote:
and *p would be pointing to an empty region of memory in main().

*p is still pointing to the same address in memory, that now is invalid but just by chance still contains some meaningfull data. If you do some additional tasks between the call to create() and the output operation, the data at the address may change.


Regards,
Tim

GeneralRe: scope in functions Pin
minkowski25-Oct-06 0:58
minkowski25-Oct-06 0:58 
GeneralRe: scope in functions Pin
Tim Paaschen25-Oct-06 1:03
Tim Paaschen25-Oct-06 1:03 
AnswerRe: scope in functions Pin
kakan25-Oct-06 1:10
professionalkakan25-Oct-06 1:10 
GeneralRe: scope in functions Pin
benjymous25-Oct-06 1:24
benjymous25-Oct-06 1:24 
GeneralRe: scope in functions Pin
kakan25-Oct-06 1:53
professionalkakan25-Oct-06 1:53 
GeneralRe: scope in functions Pin
benjymous25-Oct-06 3:29
benjymous25-Oct-06 3:29 
GeneralRe: scope in functions [modified] Pin
toxcct25-Oct-06 1:41
toxcct25-Oct-06 1:41 
GeneralRe: scope in functions [modified] Pin
kakan25-Oct-06 1:53
professionalkakan25-Oct-06 1:53 
GeneralRe: scope in functions Pin
toxcct25-Oct-06 2:25
toxcct25-Oct-06 2:25 
GeneralRe: scope in functions Pin
kakan25-Oct-06 3:26
professionalkakan25-Oct-06 3:26 
GeneralRe: scope in functions Pin
toxcct25-Oct-06 3:31
toxcct25-Oct-06 3:31 
GeneralRe: scope in functions Pin
kakan25-Oct-06 3:46
professionalkakan25-Oct-06 3:46 
GeneralRe: scope in functions Pin
toxcct25-Oct-06 3:51
toxcct25-Oct-06 3:51 
GeneralRe: scope in functions Pin
kakan25-Oct-06 4:01
professionalkakan25-Oct-06 4:01 
GeneralRe: scope in functions Pin
minkowski25-Oct-06 4:07
minkowski25-Oct-06 4:07 
GeneralRe: scope in functions Pin
kakan25-Oct-06 4:10
professionalkakan25-Oct-06 4:10 
GeneralRe: scope in functions Pin
minkowski25-Oct-06 4:21
minkowski25-Oct-06 4:21 

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.