小弟最近在看很多sepc,注意到constant这个字好像跟我心目中的定义不太一样。
我一直以为 3, 0x2A, 0b10001000这些就是所谓的constant
但看到这份文件: https://en.wikipedia.org/wiki/Constant_(computer_programming)#Comparison_with_literals_and_macros
Definition: a constant is a value that cannot be altered by the program during
normal execution
这段给我的感觉是,只要在normal exectuion的过程中,值不被改变就叫constant
问题一:什么是normal execution?
接着文件又说: When associated with an identifier, a constant is said to be
"named," although the terms "constant" and "named constant" are often used
interchangeably.
这段告诉我的意思是,以下程式码:
int a = 3;
只要a的值在normal execution过程中没有被改变,那a就叫 named constant,并不叫
variable.
请问各位大大,我理解的方向是正确的吗?