c - C 中 "* "、 "* "和 "*"指针之间的区别

标签 c pointers graph adjacency-list

<分区>

我正在从极客到极客学习图(邻接表),我看到了这段代码:

// A structure to represent an adjacency list node
struct AdjListNode
{
    int dest;
    struct AdjListNode* next;
};

// A structure to represent an adjacency liat
struct AdjList
{
    struct AdjListNode *head;  // pointer to head node of list
};

// A structure to represent a graph. A graph is an array of adjacency lists.
// Size of array will be V (number of vertices in graph)
struct Graph
{
    int V;
    struct AdjList* array;
};

我想知道两者之间的区别:

struct AdjListNode* next;struct AdjListNode *head;struct AdjListNode * head;

最佳答案

它们是相同的,只是“指向结构 AdjListNode 的指针”的写法不同。

关于c - C 中 "* "、 "* "和 "*"指针之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30400926/

相关文章:

javascript - 使用 PHP 和 JavaScript 从心跳列表构建正常运行时间图

r - 在 R 上具有两个不同变量的条形图

c - 在lapack的dgels函数中使用malloc

c - 如何保留稍后销毁的字符串的内容?

c++ - 现代 C++ 函数返回函数指针的方式

c++ - 指针有拷贝构造函数吗?

java - 是否有一个库可以从数据存储/数据库中保存荣格图

c++ - C/C++ 以一定的精度高效地四舍五入小数

c - 如何更改内核空间堆的权限?

c# - 这是三元运算符的合理使用吗?