1. struct node {
2. char data;
3. struct node* nxtPtr;
4. }
5.
6. typedef struct node Node;
7.
8. Node* front = NULL;
9. Node* end = NULL;
10.
11. void enqueue(char userData)
12. {
13. Node* temp = malloc(sizeof(Node));
14. temp->data = userData;
15. temp->nxtPtr = ???
16. }
I have kept the code to a minimum to try and avoid confusion. Eventually the variable end will point to a Node structure containing a data element and a Node pointer element. On line 15 I would like to de-reference end to access the value stored in nxtPtr from the current end Node. However the following line
temp->nxtPtr = *end->nxtPtr;
gives the following gcc error
incompatible types when assigning to type ‘struct node *’ from type ‘struct node’