求教关于keil编译出错的问题

[复制链接]
 楼主| jack_shine 发表于 2010-5-12 13:56 | 显示全部楼层 |阅读模式
uchar code array_1[6]={0x40,0x1f,0xff,0xff,0x00,0x1f};
uchar code array_5[8]={0xfe,0x1f,0x44,0x1f,0x44,0x2f,0x47,0xcf};
uchar code array_9[8]={0x7c,0x0f,0x82,0x1f,0x82,0x2f,0x7f,0xcf};
uchar code array_0[8]={0x7f,0xef,0x80,0x1f,0x80,0x1f,0x7f,0xef};
uchar code array_7[8]={0x80,0x0f,0x83,0xff,0x84,0x0f,0xf8,0x0f};
uchar code array_8[8]={0x7b,0xef,0x84,0x1f,0x84,0x1f,0x7b,0xef};
uchar code array_6[8]={0x3f,0xef,0x44,0x1f,0x84,0x1f,0x03,0xef};
uchar code array_3[8]={0x40,0x2f,0x84,0x1f,0x84,0x1f,0x7b,0xef};
uchar *p[]={array_1,array_5,array_9,array_0,array_1,array_7,array_8,array_6,array_7,array_5,array_3};

void phone_no_move()
{
while(*p!='\0')
{
  no_code=*p;
  send_cmd(0x0f00|no_code);
         p++;
         }
}

我写的代码如上,定义了一个指针数组,然后编译出现“p”:not a lvalue,
p++;的地方出现这种错误,还望哪位大侠指点小弟此错啥意思,如何修改,谢谢了!
}
 楼主| jack_shine 发表于 2010-5-14 14:20 | 显示全部楼层
见侃单片机
 楼主| jack_shine 发表于 2010-5-14 14:21 | 显示全部楼层
见侃单片机
jack_shine 发表于 2010-5-14 14:20

chenxiaocong 发表于 2010-10-12 01:25 | 显示全部楼层
p不能加,它是个数组
whlchh 发表于 2010-11-3 09:54 | 显示全部楼层
你定义的指针p是个数组,所以p不能加,而是数组p[0]等相加p[0]++;array_1的首地址是指针p[0]的首地址
 楼主| jack_shine 发表于 2011-5-6 16:43 | 显示全部楼层
ture_2010 发表于 2011-5-6 18:35 | 显示全部楼层
有点深奥啊
mars5514 发表于 2011-7-4 08:46 | 显示全部楼层
newstary 发表于 2011-7-22 14:32 | 显示全部楼层
p为数组名,编译时被翻译成成常量(即数组起始地址),不能进行自加运算
jy1975jy1975 发表于 2011-8-3 17:30 | 显示全部楼层
实在不会,飞过
lukyoo 发表于 2011-8-19 20:30 | 显示全部楼层
&P++;可以不
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:多关注自己专业的东西 网络上太多资料鸟,看来只适合查阅,不适合检阅鸭 技术交流群:206660396

3

主题

3044

帖子

2

粉丝
快速回复 在线客服 返回列表 返回顶部