Pointer: 0 xcccccccc The debug version of VC automatically initializes Uninitialized pointers
0 xcccccccc, Instead of randomly removing it, it is because the purpose of the debug version is to facilitate debugging. Program If the initial values of the wild pointer are uncertain, different results may occur every time you debug the same program. For example, this program crashes and runs normally next time, but the result is incorrect ...... It is obviously very unfavorable for us to solve the bug.
The debug version initializes the data pair on the stack into 0xcc to allow programmers to discover errors earlier. That is to say, if the local variable is not initialized, it will be 0xcc In the debug version.
For debugging convenience, that is, its edit and continue feature, debug allocates 64 bytes for each function. When debuggingCodeWhen a small number of variables are added, the compiler can allocate the 64 bytes of space in the past, so that the program does not need to be re-compiled for re-debugging.
INT:-858993460 (hexadecimal oxcccccccc) (Binary 11001100110011001100110011001100) A. When an uninitialized value is assigned (at least the memory not initialized under VC), the default value is 0 xcccccccc ;, in the memory, it is saved as-858993460 by default, that is, the binary 11001100 11001100 11001100 11001100; The hexadecimal cccccc; and the Chinese character "hot" encoding is exactly 1100110011001100:
B. If the data type of the variable overflows due to your operation, the system will automatically change to-858993460 in the memory.
Unsigned, unsigned long: 3435973836(Oxcccccccc) (11001100110011001100110011001100)
Short:-13108(0 xcccc) (1100110011001100)
CHAR:-52 '? 'Where-52 is (0xcc) (11001100)
Double, long double:-9.2559631349317831e + 061
Bool: True