I'm trying to write a linked list, with the restriction being that the pointer inside of a node has to point to the next node's pointer. With this restriction, how would I ever access a variable inside of a node? Say the node is defined
struct Node {
int val;
void *next;
}
but for every Node, say we have currentNode and nextNode, we make the void *next value
currentNode.next = &(nextNode.next);
How would you go about creating this and efficiently accessing each node?