摘要: #include <stdio.h> enum Sex{ MALE, FEMALE, SECRET}; enum Color{ RED, YELLOW, BLUE};int main(void){ enum Sex s = MALE; return 0;} 联合公用体 阅读全文
posted @ 2022-04-29 18:41 藏进夜里躲在光下 阅读(23) 评论(0) 推荐(0)
摘要: #include <stdio.h> struct S{int a : 2; //a 只需要2个比特位int b : 5; // b 只需要5个比特位int c : 10;int d : 30; };int main(void){struct S s;printf("%d\n", sizeof(s) 阅读全文
posted @ 2022-04-29 17:50 藏进夜里躲在光下 阅读(35) 评论(0) 推荐(0)
摘要: #include <stdio.h>struct S1{ char c1; int a; char c2;}; struct S2{ char c1; char c2; int a;}; struct S3 { double b;char c1;int a;}; struct S4 { double 阅读全文
posted @ 2022-04-29 13:23 藏进夜里躲在光下 阅读(30) 评论(0) 推荐(0)