|
楼主 |
发表于 2011-12-14 19:23:56
|
显示全部楼层
回复【5楼】zhaoxukiller 搁浅的夜
谢谢楼上各位,我还有个问题,msp430对结构体 即: struct关键字的定义支持如何。为什么我用c的程序编写有错误
error[pe144]: a value of type "char *" cannot be used to initialize an entity of type "char" e:\workmsp430\new_1\str.c 11
#include "msp430x54x.h"
void main(void)
{
struct stu
{
int num;
char name[20];
char sex;
char addr[20];
} stu1={10000,"mikey","m","changchun"};
}
-----------------------------------------------------------------------
现在貌似找到点问题
如果stu1初始化如下就没有错误,具体我还没试,修改如下:
#include "msp430x54x.h"
void main(void)
{
struct stu
{
int num;
char name[20];
char sex;
char addr[20];
} stu1={10000,{"mikey"},4,{"changchun"}};
} |
|