Language: C

#include<stdio.h>
#include<stdlib.h>

 struct Node{
           struct Node *prev;
           struct Node *next;
           int key;
           };

 typedef struct Node *Nodepointer;

 Nodepointer nil;

 void init(){
          nil=malloc(sizeof(struct Node));

          nil->prev=nil;
          nil->next=nil;
          }

 void printlist(){
          Nodepointer ser=nil->next;
          int isf=1;

          while(1){
                 if(ser==nil)break;
                 if(isf==0)printf(" ");
                 printf("%d",ser->key);
                 ser=ser->next;
                 isf=0;
                 }
          printf("\n");
          }


 void insert(int key){
          Nodepointer x=malloc(sizeof(struct Node));
          x->key=key;

          nil->next->prev=x;
          x->next=nil->next;
          nil->next=x;
          x->prev=nil;
          }

 Nodepointer serch(int key){
          Nodepointer ser=nil->next;
          while(ser != nil && ser->key != key){
                       ser=ser->next;
                       }
          return ser;
          }
          

 void delete(Nodepointer x){
          if(x==nil)return;
          x->prev->next=x->next;
          x->next->prev=x->prev;
          free(x);
          }

 void deletefirst(){
          NodePointer t = nil->next;
  if ( t == nil ) return;
  delete(t);
}

 int deletelast(){
          NodePointer t = nil->prev;
  if (t == nil) return;
  delete(t);
}
 int deletekey(int key){
          delete(serch(key));
          }

 int main(){
       int i,n,k;
       char com[20];
       init();
       scanf("%d",&n);
       for(i=0;i<n;i++){
                 scanf("%s %d",&com,&k);
                 
                 if(com[0]=='i'){insert(k);}
                 else if(com[0]=='d'){
                               if(strlen(com)>6){  
                                     if(com[6]=='F'){deletefirst();}
                                     else if(com[6]=='L'){deletelast();}
                                     }
                               }else{delete(k);}
                }
       printlist();
       return 0;
       }







Compiler output:
main.c: In function 'deletefirst':
main.c:63:11: error: unknown type name 'NodePointer'; did you mean 'Nodepointer'?
   63 |           NodePointer t = nil->next;
      |           ^~~~~~~~~~~
      |           Nodepointer
main.c:63:27: error: initialization of 'int' from 'struct Node *' makes integer from pointer without a cast [-Wint-conversion]
   63 |           NodePointer t = nil->next;
      |                           ^~~
main.c:64:10: warning: comparison between pointer and integer
   64 |   if ( t == nil ) return;
      |          ^~
main.c:65:10: error: passing argument 1 of 'delete' makes pointer from integer without a cast [-Wint-conversion]
   65 |   delete(t);
      |          ^
      |          |
      |          int
main.c:55:26: note: expected 'Nodepointer' {aka 'struct Node *'} but argument is of type 'int'
   55 |  void delete(Nodepointer x){
      |              ~~~~~~~~~~~~^
main.c: In function 'deletelast':
main.c:69:11: error: unknown type name 'NodePointer'; did you mean 'Nodepointer'?
   69 |           NodePointer t = nil->prev;
      |           ^~~~~~~~~~~
      |           Nodepointer
main.c:69:27: error: initialization of 'int' from 'struct Node *' makes integer from pointer without a cast [-Wint-conversion]
   69 |           NodePointer t = nil->prev;
      |                           ^~~
main.c:70:9: warning: comparison between pointer and integer
   70 |   if (t == nil) return;
      |         ^~
main.c:70:17: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   70 |   if (t == nil) return;
      |                 ^~~~~~
main.c:68:6: note: declared here
   68 |  int deletelast(){
      |      ^~~~~~~~~~
main.c:71:10: error: passing argument 1 of 'delete' makes pointer from integer without a cast [-Wint-conversion]
   71 |   delete(t);
      |          ^
      |          |
      |          int
main.c:55:26: note: expected 'Nodepointer' {aka 'struct Node *'} but argument is of type 'int'
   55 |  void delete(Nodepointer x){
      |              ~~~~~~~~~~~~^
main.c: In function 'main':
main.c:87:35: error: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
   87 |                                if(strlen(com)>6){
      |                                   ^~~~~~
main.c:3:1: note: include '<string.h>' or provide a declaration of 'strlen'
    2 | #include<stdlib.h>
  +++ |+#include <string.h>
    3 | 
main.c:87:35: warning: incompatible implicit declaration of built-in function 'strlen' [-Wbuiltin-declaration-mismatch]
   87 |                                if(strlen(com)>6){
      |                                   ^~~~~~
main.c:87:35: note: include '<string.h>' or provide a declaration of 'strlen'
main.c:91:45: error: passing argument 1 of 'delete' makes pointer from integer without a cast [-Wint-conversion]
   91 |                                }else{delete(k);}
      |                                             ^
      |                                             |
      |                                             int
main.c:55:26: note: expected 'Nodepointer' {aka 'struct Node *'} but argument is of type 'int'
   55 |  void delete(Nodepointer x){
      |              ~~~~~~~~~~~~^