我已经了解了指针,但是当指针出现在像这样的变量末尾时,这意味着什么。
struct student_record_node
{
struct class_record* record_;
struct class_record_node* next_;
};
最佳答案
这不是变量的结尾。 student_record_node
是用户定义的数据类型,使用结构说明符 struct
关键字指定。
引自wikipedia article对此,(强调我的)
A
struct
in the C programming language (and many derivatives) is a complex data type declaration that defines a physically grouped list of variables to be placed under one name in a block of memory, allowing the different variables to be accessed via a single pointer, or the struct declared name which returns the same address.
在你的情况下,
struct student_record_node
{
struct class_record* record_;
struct class_record_node* next_;
};
是用户定义类型struct student_record_node
的声明,您可以通过以下语句创建该类型的变量
struct student_record_node stu_record; //stu_record is the variable name
关于c - 当指针出现在变量(指针*)的末尾时,这意味着什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40582146/