结构体成员数组初始化

时间:2021-11-19 19:48:35

typedef struct {
    int  protocol_id;     //protocol ID
    char  Protocol_Describe[PTZ_PROTOCOL_DESCRIPT_LEN];
}ptz_protocol;

typedef struct PTZ_SUPPORTPROTOCOL{  

  int  structsize;        

  char  dwPtzCount;

  ptz_protocol PtzItemList[PTZ_PROTOCOL_MAX_COUNT];

}ptz_supportprotocol; 

 

ptz_supportprotocol support_rsp={

    sizeof(ptz_supportprotocol),
    3,
    .PtzItemList[0]={ 0, "PELCO_D"},
     .PtzItemList[1]={ 1, "PELCO_P"},
    .PtzItemList[2]={ 2, "GAT647_2006"}
    //.PtzItemList[3]={ 3, "TRANSPARANT"},
};