C/C++ Arena

Step 1 of 6

A node that points to a node

A linked list is a chain of nodes. Each node holds a value and a pointer to the next node. The last node's next is NULL.

struct Node {
    int value;
    struct Node *next;
};

A struct can contain a pointer to its own type, even though it can't contain itself.

Your turn: link three stack-allocated nodes together and walk the list.

Next: Push to the front