小编Art*_*hur的帖子

关于链表中结构语法的问题

我对链式列表中的结构的语法有疑问:

我有这个链表结构:

typedef struct      s_list
{
    void            *content;
    size_t          content_size;
    struct s_list   *next;
} t_list;
Run Code Online (Sandbox Code Playgroud)

我想将void*内容指向此结构:

typedef struct      s_minos
{
    char            **minos;
}                   t_minos;
Run Code Online (Sandbox Code Playgroud)

但是当我试图像这样访问我的char**minos时:

printf("%s\n", head->content->singleminos->minos[i]);
Run Code Online (Sandbox Code Playgroud)

我宣布:s_minos *singleminos; 我分配了:head->content = singleminos;

它不起作用.

我该如何正确访问我的数据?

c struct linked-list

2
推荐指数
1
解决办法
56
查看次数

标签 统计

c ×1

linked-list ×1

struct ×1