Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
 
struct node{/*???????????????*/
  unsigned int key;
  struct node *next;
  struct node *prev;
};
 
typedef struct node * NodePointer;
 
NodePointer nil;
 
NodePointer listSearch(int key){
  NodePointer p;
  int i;
  p=nil->next;
 
  while((p != nil) && (p->key!=key)){
    p=p->next;
  }
    return p;
 
}
 
void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}
 
void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}
 
void deleteNode(NodePointer t){
  /*node ????¶????*/
  t->prev->next=t->next;
  t->next->prev=t->prev;
}
 
void deleteFirst(){
  /*???????????????????????????*/
  NodePointer t = nil->next;
  if ( t == nil )return;
  deleteNode(t);
}
 
void deleteLast(){
  /*????????????????????????*/
  NodePointer t=nil->prev;
  if(t==nil)return;
  deleteNode(t);
 
}
 
void delete(int key){
 
  NodePointer tea;
  if((tea=listSearch(key))!= NULL){
    if(tea == nil) return;
    deleteNode(tea);
    }
}
 
 
void insert(int key){
  /*?????\*/
  NodePointer new;
  new = malloc(sizeof(struct node));
  new->key = key;
  new->next=nil->next;
   
  nil->next->prev=new;
 
  nil->next=new;
 
  new->prev=nil;
}
 
 
 
int main(void){
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s%d", com, &key);
    if ( com[0] == 'i' ) {insert(key); np++; size++;}
    else if ( com[0] == 'd' ) {
      if (strlen(com) > 6){
        if ( com[6] == 'F' ) {
deleteFirst();
}
        else if ( com[6] == 'L' ) deleteLast();
      } else {
        delete(key); nd++; 
      }
      size--;
    }
  }
 
  printList();
  return 0;
}

Compiler output:
a.cc: In function 'void init()':
a.cc:28:15: error: invalid conversion from 'void*' to 'NodePointer' {aka 'node*'} [-fpermissive]
   28 |   nil = malloc(sizeof(struct node));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~
      |               |
      |               void*
a.cc: At global scope:
a.cc:67:6: error: expected unqualified-id before 'delete'
   67 | void delete(int key){
      |      ^~~~~~
a.cc: In function 'void insert(int)':
a.cc:79:15: error: expected unqualified-id before 'new'
   79 |   NodePointer new;
      |               ^~~
a.cc:80:7: error: expected type-specifier before '=' token
   80 |   new = malloc(sizeof(struct node));
      |       ^
a.cc:81:6: error: expected type-specifier before '->' token
   81 |   new->key = key;
      |      ^~
a.cc:82:6: error: expected type-specifier before '->' token
   82 |   new->next=nil->next;
      |      ^~
a.cc:84:22: error: expected type-specifier before ';' token
   84 |   nil->next->prev=new;
      |                      ^
a.cc:86:16: error: expected type-specifier before ';' token
   86 |   nil->next=new;
      |                ^
a.cc:88:6: error: expected type-specifier before '->' token
   88 |   new->prev=nil;
      |      ^~
a.cc: In function 'int main()':
a.cc:110:16: error: type 'int' argument given to 'delete', expected pointer
  110 |         delete(key); nd++;
      |               ~^~~~