|
From: K�r�at on 8 May 2008 06:37 Hi, While I debugging an appliation I noticed an interesting nuance. If I build the application with Debug configuration and then successively call a function, the local variables of that function is not preserve their previous values. But If I build with Release configuration and do same things then the result is interesting: local variables preserve their previous values as if they static. What is the difference?
From: David Wilkinson on 8 May 2008 07:33 "K������������������" wrote: > Hi, > > While I debugging an appliation I noticed an interesting nuance. If I build > the application with Debug configuration and then successively call a > function, the local variables of that function is not preserve their > previous values. But If I build with Release configuration and do same > things then the result is interesting: local variables preserve their > previous values as if they static. What is the difference? K: This is implementation detail of VC. In release mode, local variables are not initialized, so variables may or may not retain their values. In debug mode, variables are initialized to special values, so the old values are always destroyed. -- David Wilkinson Visual C++ MVP
|
Pages: 1 Prev: C2664 on initializing auto_ptr with const patam in constructor Next: Access Violation? |