【发布时间】:2023-01-05 20:53:05
【问题描述】:
struct node{
int data;
struct node*next;
};
struct node * a[26];
我们是在制作节点指针数组还是为节点指针分配大小? 请帮助我解决这个问题。
【问题讨论】:
标签: c
struct node{
int data;
struct node*next;
};
struct node * a[26];
我们是在制作节点指针数组还是为节点指针分配大小? 请帮助我解决这个问题。
【问题讨论】:
标签: c
struct node * a[26]; 将 a 声明为一个包含 26 个指向 struct node 的指针的数组。
【讨论】:
本声明
struct node * a[26];
声明一个名为a 的数组,其中26 元素的指针类型为struct node *。
这两个声明
struct node{
int data;
struct node*next;
};
struct node * a[26];
也可以通过以下方式重写为一个声明
struct node{
int data;
struct node*next;
} * a[26];
【讨论】: