这就是typedef 的作用
当有typedef 时
typedef struct {
QueuePtr front;
QueuePtr rear;
}LinkQueue;
则LinkQueue 变是类型号名
下面声明变量就可以
LinkQueue a
如没有typedef 时
如StructLinkQueue{
QueuePtr front;
QueuePtr rear;
}
则声明变量时就必须这样
StructLinkQueue a
所以
typedef struct定义结构体时,后面可以不加类型名了
关于typedef struct定义结构体时,为什么struct后面可以不加类型名
关于typedef struct定义结构体时,为什么struct后面可以不加类型名
例如这样子
typedef struct {
\x09QueuePtr front;
\x09QueuePtr rear;
}LinkQueue;
这样写是对的?
例如这样子
typedef struct {
\x09QueuePtr front;
\x09QueuePtr rear;
}LinkQueue;
这样写是对的?
数学人气:259 ℃时间:2020-03-26 03:23:45
优质解答
我来回答
类似推荐
猜你喜欢
- 11We have time for one more person.2We
- 2函数f(x)=(x2-2x+9)/x(x
- 3各路大虾帮帮忙! 填介词:She is ___the dentist's. Paul goes to the hospital ____his grandfather.
- 4Dad missed a step and fell,___the new suitcase rolling down the stairs.
- 5〈〈安塞腰鼓〉〉中有精彩的舞蹈场面的描写,你能根据下面的提示写出相应的成语吗?
- 6Two men from the US were traveling in Spain.One morning,they 91_____________ into a little restaurant for lunch.
- 7请问一个20尺货柜能装多少箱.尺寸为 35.5*24.5*17 CM的纸箱..重量是28KG/箱的.
- 8解方程:3x的平方+15x+2根号x的平方+5x+2=50.
- 9一长方体的体积与一正方体的体积相等,则长方体的表面积__正方体的表面积(比较大小)
- 10一本名著共300页,小明计划6天读完,第一天读了60页,现要比原计划提前2天读完,那么以后每天平均至少读