array type has incomplete element type


  extern   struct  SoundReport SoundList[32];     ///// 多写了  struct  


typedef struct
{
u8 SoundContent[50];//语音播报的内容 注:以null为结束标志
const char Priority; //语音播报优先级  注:10为最高,0为最低
char Len; //声音数据长度
char Flag; //标识位
// char *Str; //声音标识
} SoundReport;


既然 已经  typedef  , 那么   SoundRepor 就 类似于 int , 不需要 在前面添加  struct  。 



//// 摘录笔记

在C中定义一个结构体类型要用typedef:
    typedef struct Student
    {
    int a;
    }Stu;
    于是在声明变量的时候就可:Stu stu1;(如果没有typedef就必须用struct Student stu1;来声明)
    这里的Stu实际上就是struct Student的别名。Stu==struct Student
    


另外这里也可以不写Student(于是也不能struct Student stu1;了,必须是Stu stu1;)
    typedef struct
    {
    int a;
    }Stu;
    但在c++里很简单,直接
    struct Student
    {
    int a;
    };    
    于是就定义了结构体类型Student,声明变量时直接Student stu2;




posted on 2014-09-12 13:58  醉依危栏听松涛  阅读(1780)  评论(0编辑  收藏  举报