struct example{ enum { chaos,//没有初始化,错误的状态 int_t,//存的是int chars_t,//存的是char } type; union { int a; char b[50]; };}flag[10];
每次修改的时候手动设置type的值,没有别的办法