Default values in array

前端 未结 4 1519
逝去的感伤
逝去的感伤 2021-01-02 05:39

What are default values for arrays like this:

char c[20];

?

BTW, Are there any?

4条回答
  •  悲哀的现实
    2021-01-02 06:34

    Undefined or in less technical language - random.

    Your compiler (at least in debug mode) may set it to a particular value for testing.

    And of course from a strict Copenhagen interpretation of quantum theory the value it does have is both indeterminate (used in it's correct sense) until you collapse the wavefunction by measuring it.

提交回复
热议问题