|
发表于 2010-9-29 06:28:32
|
显示全部楼层
"const是标准C语言的一个关键字,它限定一个变量不允许被改变。核心是:不允许被改变! "
more precisely, a variable declared "const" means that you cannot write to it. "const" declaration by itself does not imply any storage class (flash vs. ram for example).
however, most compilers will treat a "const" declared variable in flash.
But there are exceptions to that, as you are find out here in ICC, as well as Keil C51 where you have to declare a const variable "code" to force it to be stored in flash.
again, the surest bet is to read the compiler manual. |
|