C++ typedef struct 用法总结(浓缩就是精华)

typedef是类型定义的意思,


在C++中,第一种

struct Student
{
int a;
}stu1;//这里的变量可有可无,这里只定义变量
下面是第二种

typedef struct Student2
{
int a;
}stu2;//这是一个结构体类型

怎么说呢,就比如int a;int是一个类型,a是一个变量;同理,stu1是定义的一个变量,stu2是类型,stu2可以用来定义变量

没了,就这么少!浓缩的奋斗

猜你喜欢

转载自blog.csdn.net/CWY_007/article/details/78618744