Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct Node {
struct Node *prev;
int key;
struct Node *next;
} NodePointer;
NodePointer head;
void insert(int );
void delate(NodePointer *);
int main()
{
int i,num,z;
NodePointer *p;
char process[15];
int key;
head = malloc(sizeof(NodePointer));
head->next = &head;
head->prev = &head;
scanf("%d",&num);

for(i=0;i<num;i++)
{
z=scanf("%s",process);
if(z==EOF) break;
if(strcmp(process ,"insert")==0) 
{
scanf("%d",&key);
insert(key);
}
else if(strcmp(process,"delete")==0)
{
scanf("%d",&key);
for(p=head->next;p->key!=key;p=p->next)
{
}
delate(p);
}

else if (strcmp(process,"deleteFirst")==0) delate(head->next);
else delete(head->prev);
}

for(p=head->next; p!=head->prev; p=p->next)
{
printf("%d ",*p->key);
}
return 0;
}

void insert (int key)
{
NodePointer x;
x=malloc(sizeof(NodePointer));
x->key = key;
x->next = head->next;
head->next->prev = &x;
head->next = &x;
x->prev = &head;
}

void delete(NodePointer *x)
{
x->prev->next = x->next;
x->next->prev = x->prev;
free(x);
}

Compiler output:
main.c: In function 'main':
main.c:18:8: error: incompatible types when assigning to type 'NodePointer' {aka 'struct Node'} from type 'void *'
   18 | head = malloc(sizeof(NodePointer));
      |        ^~~~~~
main.c:19:5: error: invalid type argument of '->' (have 'NodePointer' {aka 'struct Node'})
   19 | head->next = &head;
      |     ^~
main.c:20:5: error: invalid type argument of '->' (have 'NodePointer' {aka 'struct Node'})
   20 | head->prev = &head;
      |     ^~
main.c:35:11: error: invalid type argument of '->' (have 'NodePointer' {aka 'struct Node'})
   35 | for(p=head->next;p->key!=key;p=p->next)
      |           ^~
main.c:41:55: error: invalid type argument of '->' (have 'NodePointer' {aka 'struct Node'})
   41 | else if (strcmp(process,"deleteFirst")==0) delate(head->next);
      |                                                       ^~
main.c:42:6: error: implicit declaration of function 'delete'; did you mean 'delate'? [-Wimplicit-function-declaration]
   42 | else delete(head->prev);
      |      ^~~~~~
      |      delate
main.c:42:17: error: invalid type argument of '->' (have 'NodePointer' {aka 'struct Node'})
   42 | else delete(head->prev);
      |                 ^~
main.c:45:11: error: invalid type argument of '->' (have 'NodePointer' {aka 'struct Node'})
   45 | for(p=head->next; p!=head->prev; p=p->next)
      |           ^~
main.c:45:26: error: invalid type argument of '->' (have 'NodePointer' {aka 'struct Node'})
   45 | for(p=head->next; p!=head->prev; p=p->next)
      |                          ^~
main.c:47:14: error: invalid type argument of unary '*' (have 'int')
   47 | printf("%d ",*p->key);
      |              ^~~~~~~
main.c: In function 'insert':
main.c:55:3: error: incompatible types when assigning to type 'NodePointer' {aka 'struct Node'} from type 'void *'
   55 | x=malloc(sizeof(NodePointer));
      |   ^~~~~~
main.c:56:2: error: invalid type argument of '->' (have 'NodePointer' {aka 'struct Node'})
   56 | x->key = key;
      |  ^~
main.c:57:2: error: invalid type argument of '->' (have 'NodePointer' {aka 'struct Node'})
   57 | x->next = head->next;
      |  ^~
main.c:57:15: error: invalid type argument of '->' (have 'NodePointer' {aka 'struct Node'})
   57 | x->next = head->next;
      |               ^~
main.c:58:5: error: invalid type argument of '->' (have 'NodePointer' {aka 'struct Node'})
   58 | head->next->prev = &x;
      |     ^~
main.c:59:5: error: invalid type argument of '->' (have 'NodePointer' {aka 'struct Node'})
   59 | head->next = &x;
      |     ^~
main.c:60:2: error: invalid type argument of '->' (have 'NodePointer' {aka 'struct Node'})
   60 | x->prev = &head;
      |  ^~
main.c: At top level:
main.c:63:6: warning: conflicting types for 'delete'; have 'void(NodePointer *)' {aka 'void(struct Node *)'}
   63 | void delete(NodePointer *x)
      |      ^~~~~~
main.c:42:6: note: previous implicit declaration of 'delete' with type 'void(NodePointer *)' {aka 'void(struct Node *)'}
   42 | else delete(head->prev);
      |      ^~~~~~