什么是恒定的阵列? [英] What are constant arrays?
本文介绍了什么是恒定的阵列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是恒定的阵列?
如果我们定义
const char hex_char[] = {
'0', '1', '2', '3',
'4', '5', '6', '7',
'8', '9', 'A', 'B',
'C', 'D', 'E', 'F'
};
然后,它不应该被程序修改;这是什么意思?
Then, it should not be modified by program; What does it mean?
推荐答案
这意味着你不能修改其内容。例如你不能做 hex_char [I] ='A'
,它会导致编译时错误。
It means that you can't modify its content. For example you are not allowed to do hex_char[i] = 'A'
, it will result in compilation time error.
这篇关于什么是恒定的阵列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文