1.结构体和共用体大小判断
//结构体A,占8个字节
struct A
{
int a;
float b;
};
//联合体B(也叫共用体),占4个字节
union B
{
int a;
float b;
};
结构体和共用体的设计模型
2.结构体和typedef类型定义
typedef:类型定义,是定义类型的
typedef应用:①起个简短的别名 ②根据数据特征起别名(如size_t,time_t等能见名知意的数据类型)
①使用方法:typedef 类型名 新类型名;
typedef unsigned long long int uint64;//给unsigned long long int
//起一个别名叫uint64,64表示64位,就是8个字节,长长整型就是8个字节
int main()
{
unsigned long long int a = 1000;
unsigned long long <