-1

-52 = 0xCC

So after allocating char array in debugging windows I can see my array is filled with 0xCC. What does it mean? (-52 = 0xCC)

Disciples
  • 662
  • 1
  • 6
  • 15

2 Answers2

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