What is the usage of double pointers between two structs?

Viewed 64

I'm trying to understand something. I want a node, and I want another node that has properties of the table I'm trying to build

typedef struct Node {
    char *data;
    int moredata;
    struct Node *next 
} Node;

typedef struct Nodewrapper {
    int size;
    int elements;
    Node ** nodeptr 
} Nodewrapper;

What functionality does the nodeptr have in Nodewrapper? How can I access stuff from the Node with nodeptr? What syntax would is correct to access stuff this way?

1 Answers

I can only guess but probablt size shows how many pointers are stored and elementd how large array of structs is referenced by those pointers.

Those fields should have the type size_t.

Related