-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
  • 592
  • 3
  • 14

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
  • 47,658
  • 24
  • 139
  • 177
1

It's there as a sentinel value so that you know that the memory is uninitialized.

See the /GZ compiler switch.

RichieHindle
  • 258,929
  • 46
  • 350
  • 392