Outline ·
[ Standard ] ·
Linear+
[HELP] C++ for loop
|
xenon
|
Feb 10 2006, 01:00 PM
|
|
Can be compiled. But result unpredictable. A new local variable, before initialization, may be holding the value 0xCCCCCCCC. But depends on the code generated by compiler. A global variable, before initialization, is most likely to be 0.
|
|
|
|
|
|
xenon
|
Feb 10 2006, 04:29 PM
|
|
When entering a function, there is code to adjust the stack pointer to reserve space for local variables. Uninitialized local variables have values that come from old values from the stack that already have been pop-ed. The values are unpredictable.
When using Microsoft development tools, uninitialized local variables are set to 0xCCCCCCCC.
|
|
|
|
|