一个简单的单片机C程序

单片机里的数组无法赋值么?以下程序(节选),如果在Turbo C中,是应该没问题的,但在Keil中,就提示错了,说table[i]是unmodifiable lvalue

unsigned char code table[6];
void main()
{
for(i=6;i>=0;i--)
{
table[i]=number%10; //出错:提示unmodifiable lvalue
number=number/10;
}
……

table[i]数组无法改变,code去掉就可以了
温馨提示:答案为网友推荐,仅供参考
第1个回答  2011-06-28
unsigned char table[6]; //要定义在ram里