So I have this Linked List print function that is giving me the error:
error: invalid use of void expression
Here's the line that causes this error:
printf("[%d] -> ", *(link->pointer)); /*note: i tried to cast it to (int) but still same error. */
Here's my struct for the link; very straight forward:
typedef struct DLLNode {
void * pointer;
struct DLLNode *next;
struct DLLNode *previous;
} DLLNode;
I'm using my prepend function as so:
...
int j = 2;
prepend(&j, list);
...
so that it uses the pointer to variable two as the value the struct stores in new DLLNode as the pointer.
Could someone tell me why this is happening and what it means? Thanks for your time.