struct WARNING_FLAG           //报警

{

  unsigned int Weight;             //吊重

  unsigned int Moment;                   //力矩

  unsigned int Hight;                //高度

  unsigned int Span;            //限幅

  unsigned int Wind;               //风速

  unsigned int Rotary;            //回转

  // unsigned int Lifting; //起升

  unsigned int DipAngle;         //倾角

  unsigned int collide;         //碰撞

  unsigned int multiple;

};

struct WARNING_FLAG   stu[3];

 

struct WARNING_FLAG        * P;

struct_member1=&WARN.Weight;             //去警告结构体第一个成员的地址

struct_member2=&ER_WARN.Weight;          //去预警结构体第一个成员的地址

 

  

p=& stu[0];                          //定义的是结构体的指针,所以p++;指向的是下一个结构体。

unsigned int*struct_member1,*struct_member2;  //定义的是结构体成员的指针,所以struct_member1++;指向的是结构体的下一个成员。

 

用法:

  for(i=0;i<8;i++)                                              //结构体成员相加 

  {               

    WARN.multiple=WARN.multiple+struct_member1[i];

    ER_WARN.multiple= ER_WARN.multiple+struct_member2[i];

  }