DSP2812 编程 字符定义错误

[复制链接]
751|2
 楼主| wangchao1607 发表于 2015-10-8 20:03 | 显示全部楼层 |阅读模式
我用DSP2812 编写一段经ADDA转换后用LCD显示的程序 ,其中有一段:
   shi=a1[0]/10;
                ge=a1[0]/1;
                shifen=a1[0]/0.1;
                baifen=a1[0]/0.01;
        str2[0]="shi";
                str2[1]="ge";
                str2[2]=".";
                str2[3]="shifen";
                str2[4]="baifen";
                str2[5]="V";
总是出现这个错误“a value of type "char *" cannot be assigned to an entity of type "unsigned char"”
“ variable "shi" was set but never used”。  我定义
  unsigned char shi,ge,shifen,baifen;
  请问这是哪除了问题???
andyjian 发表于 2015-10-10 08:25 | 显示全部楼层
帅锅,shi,ge,shifen,baifen中的每个都是是字符串,例如"shi"是占用4个字节的字符串,str2[i]是无符号字符数组中的一个元素,怎么可能能赋值?
ayb_ice 发表于 2015-10-13 09:56 | 显示全部楼层
本帖最后由 ayb_ice 于 2015-10-13 09:57 编辑

是'',不是“”
另str
定义成char


您需要登录后才可以回帖 登录 | 注册

本版积分规则

11

主题

25

帖子

1

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