someone please help me out on this linked list code. it seems not to work out. it is sort of a doubly linked list. look it out.
#include<stdio.h>
#include<stdlib.h>
int count = 0;
struct node_ptr{
int value;
int no;
struct node* back;
struct node* next;
};
struct node_ptr* root;
create_new_node(int value){
struct node_ptr* head;
head = malloc(sizeof(struct node_ptr));
if(root != NULL){
head -> back = root; // error in this line
root -> next = head; // and in this line
}
else
head -> back = NULL;
head -> next = NULL;
count ++;
head -> no = count;
return head;
}
The error says incompatible assignment on the two lines. Could someone help me correct it?