/* 定义个结构体 */
struct DEMO_STR{
uint8_t name[10];
uint8_t sex[10];
...
};
struct DEMO_STRUCT{
uint32_t port;
uint8_t data[100];
struct DEMO_STR stdudent;
};
/* 定义一个结构体变量 */
struct DEMO_STRUCT mystruct;
用memset将这个结构体清0,使用
/* 清除这个结构体变量 */
memset((void *)&mystruct, 0x0, sizeof(struct DEMO_STRUCT));