So after allocating char array in debugging windows I can see my array is filled with 0xCC. What does it mean? (-52 = 0xCC)
Asked
Active
Viewed 262 times
-1
-
Show the relevant code or didn't happen. – Benjamin Bannier Apr 27 '15 at 19:31
-
1You will find the answer here: http://stackoverflow.com/questions/370195/when-and-why-will-an-os-initialise-memory-to-0xcd-0xdd-etc-on-malloc-free-new – AdamF Apr 27 '15 at 19:31
-
Protip - right click and turn on hex display so you can see the hex displays directly. – stickynotememo Jul 01 '23 at 03:23
2 Answers
2
Uninitialized built-in types have an in-determined value, trying to read it is undefined behavior.
The actual values you can see depend on the compiler: You might for example see garbage, zeroes or (what seems to be the case in your example) some special value indicating "data uninitialized".

Baum mit Augen
- 49,044
- 25
- 144
- 182
1
It's there as a sentinel value so that you know that the memory is uninitialized.
See the /GZ compiler switch.

RichieHindle
- 272,464
- 47
- 358
- 399