结构体
#include <stdio.h>
struct Person {
char i;
char a[7];
int no;
int age;
};
struct Country {
char i;
int j;
char k[7];
int a;
};
void main() {
struct Person p = {
'a', "abcdef", 1, 20
};
struct Country c = {
'a', 1, "abcdef", 20
};
printf("Person结构体占用的大小:%d\n", sizeof( struct Person ) );
printf("Country结构体占用的大小:%d\n", sizeof( struct Country ) );
}
Person结构体占用的大小:16
Country结构体占用的大小:20