简体   繁体   English

结构变量

[英]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 . fNode类型的输入参数。 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 . 您通过使用typedefstruct 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM