c - 在C中打印指向链表的双指针
问题描述
一个链表定义为:
typedef struct linkedList_struct {
short unsigned int num;
struct linkedList_struct *next ;
} linkedList;
我正在尝试打印出何时传递给函数的num
值**head
**head
int function(linkedList **head)
{
printf("%X\n, head->num); // I get error here: error: member reference base type 'linkedList*' (aka 'struct linkedList_struct *') is not a structure or union
}
如何取消引用这个指向链表节点的双指针,以便打印出head->num
值?
解决方案
推荐阅读
- python - Selenium AttributeError:“列表”对象没有属性“文本”
- oracle - 将 2 个 Oracle 查询合并为一个,其中包含一些用 null 指定的通用数据
- for-loop - C code to covert 16bit (RBG565) to grayscale image
- kubernetes - redirect request when authentication failed in Kubernetes ingress controller
- laravel - 删除 Laravel 中的重复代码 - 优化
- python - Access to one specific object via multiple threads
- nginx - Nginx - how to redirect to a new url with or without trailing slash
- r - 从matrix1中获取元素位置,以便删除matrix2中具有确定位置的每个元素
- jmeter - How to get https value from response headers in jmeter
- c# - 按自定义索引和相同性对 C# 中的列表进行排序