【发布时间】:2018-06-04 17:55:37
【问题描述】:
我在看这个example,发现里面有声明
struct edge
{
int x;
int y;
int weight;
struct edge *link;
}*front = NULL;
这实际上是什么意思?是否可以创建一个结构,它也是一个名称为front的指针,它为NULL...?
【问题讨论】:
-
语法与
int* x;相同。只是有一个struct类型而不是int。 -
A
struct只是另一种类型的变量。所以,类似于int *a = NULL;,可以创建为struct name{...} *tag = NULL;