c++——联合、枚举、类型别名

**

联合:

**

union mima
{
	unsigned long birthday;
	unsigned short ssn;
	char* pet;
};

声明变量:

mima name1;

**

枚举

**

enum weekdays{Monday,Tuesday,……}

创建变量:

weekdays today;

赋值:

today Monday;

**

类型别名

**

Typedef创建类型别名

例如:
typedef int* intpointer;

当定义整型指针时候:
intpointer point1;

发布了29 篇原创文章 · 获赞 0 · 访问量 484

猜你喜欢

转载自blog.csdn.net/qq_43771959/article/details/104505296