How does a 'const struct' differ from a 'struct'?

后端 未结 6 1528
刺人心
刺人心 2020-12-23 13:57

What does const struct mean? Is it different from struct?

6条回答
  •  盖世英雄少女心
    2020-12-23 13:57

    'const' as the word constant itself indicates means unmodifiable. This can be applied to variable of any data type. struct being a user defined data type, it applies to the the variables of any struct as well. Once initialized, the value of the const variables cannot be modified.

提交回复
热议问题