[英]Struct variable
When we have : 当我们有:
struct node {
char...
int....
struct node *....
}
typedef struct node Node;
and then we have a function like this: 然后我们有一个像这样的函数:
int function(Node f){...}
What is this f
? 这是什么
f
?
f
is an input argument of the type Node
. f
是Node
类型的输入参数。 The type Node
is synonym of the type struct node
. 类型
Node
是类型struct node
同义词。
In the statement typedef struct node Node;
在语句
typedef struct node Node;
you are giving alias name of struct node
as Node
by using typedef
. 您通过使用
typedef
将struct node
别名命名为Node
。
So in the definition of function()
所以在
function()
的定义中
int function(Node f){...}
f
is nothing but variable of struct node
type. f
只是struct node
类型的变量。
Also you can see the typedef
declaration and meanings here http://en.cppreference.com/w/c/language/typedef 您也可以在此处查看
typedef
声明和含义http://en.cppreference.com/w/c/language/typedef
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.