开发者

Variable readonly

开发者 https://www.devze.com 2023-03-20 15:25 出处:网络
How to make a variable readonly in C? const int a = 10; //Is it readonly variable开发者_开发技巧?

How to make a variable readonly in C?

const int a = 10; //Is it readonly variable开发者_开发技巧?

If not, How readonly variable looks like in C? Please give an example.


It is readonly. But if you will use pointers' magic not accurately you can at random edit it


Yes it is, const allow a single initialisation at the definition.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号