Language: C++

#include <cstdio>
#include <cstdlib>
#include <cstring>

typedef struct node {
  int key;
  Node *prev, *next;
} N;

N *nil;

void init() {
  nil = (N *)malloc(sizeof(N));
  nil->next = nil;
  nil->prev = nil;
}

N* listSearch(int key) {
  N *cur = nil->next;
  while ( cur != nil && cur->key != key ) {
    cur = cur->next;
  }
  return cur;
}

void printList() {
  N *cur = nil->next;
  int isf = 0;
  while ( 1 ) {
    if ( cur == nil ) break;
    if ( isf++ > 0 ) printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
  }
  printf("\n");
}

void deleteNode(N *t) {
  if ( t == nil ) return;
  t->prev->next = t->next;
  t->next->prev = t->prev;
  free(t);
}

void insert(int key) {
  N *x = (N *)malloc(sizeof(N));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
nil->next = x;
  x->prev = nil;
}

void deleteFirst() {
  deleteNode(nil->next);
}

void deleteLast() {
  deleteNode(nil->prev);
}

void deletekey(int key) {
  deleteNode(listSearch(key));
}

int main() {
  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 {
        deleteKey(key); nd++;
      }
      size--;
    }
  }

  printfList();

  return 0;
}

Compiler output:
a.cc:7:3: error: 'Node' does not name a type; did you mean 'node'?
    7 |   Node *prev, *next;
      |   ^~~~
      |   node
a.cc: In function 'void init()':
a.cc:14:8: error: 'N' {aka 'struct node'} has no member named 'next'
   14 |   nil->next = nil;
      |        ^~~~
a.cc:15:8: error: 'N' {aka 'struct node'} has no member named 'prev'
   15 |   nil->prev = nil;
      |        ^~~~
a.cc: In function 'N* listSearch(int)':
a.cc:19:17: error: 'N' {aka 'struct node'} has no member named 'next'
   19 |   N *cur = nil->next;
      |                 ^~~~
a.cc:21:16: error: 'N' {aka 'struct node'} has no member named 'next'
   21 |     cur = cur->next;
      |                ^~~~
a.cc: In function 'void printList()':
a.cc:27:17: error: 'N' {aka 'struct node'} has no member named 'next'
   27 |   N *cur = nil->next;
      |                 ^~~~
a.cc:33:16: error: 'N' {aka 'struct node'} has no member named 'next'
   33 |     cur = cur->next;
      |                ^~~~
a.cc: In function 'void deleteNode(N*)':
a.cc:40:6: error: 'N' {aka 'struct node'} has no member named 'prev'
   40 |   t->prev->next = t->next;
      |      ^~~~
a.cc:40:22: error: 'N' {aka 'struct node'} has no member named 'next'
   40 |   t->prev->next = t->next;
      |                      ^~~~
a.cc:41:6: error: 'N' {aka 'struct node'} has no member named 'next'
   41 |   t->next->prev = t->prev;
      |      ^~~~
a.cc:41:22: error: 'N' {aka 'struct node'} has no member named 'prev'
   41 |   t->next->prev = t->prev;
      |                      ^~~~
a.cc: In function 'void insert(int)':
a.cc:48:6: error: 'N' {aka 'struct node'} has no member named 'next'
   48 |   x->next = nil->next;
      |      ^~~~
a.cc:48:18: error: 'N' {aka 'struct node'} has no member named 'next'
   48 |   x->next = nil->next;
      |                  ^~~~
a.cc:49:8: error: 'N' {aka 'struct node'} has no member named 'next'
   49 |   nil->next->prev = x;
      |        ^~~~
a.cc:50:6: error: 'N' {aka 'struct node'} has no member named 'next'
   50 | nil->next = x;
      |      ^~~~
a.cc:51:6: error: 'N' {aka 'struct node'} has no member named 'prev'
   51 |   x->prev = nil;
      |      ^~~~
a.cc: In function 'void deleteFirst()':
a.cc:55:19: error: 'N' {aka 'struct node'} has no member named 'next'
   55 |   deleteNode(nil->next);
      |                   ^~~~
a.cc: In function 'void deleteLast()':
a.cc:59:19: error: 'N' {aka 'struct node'} has no member named 'prev'
   59 |   deleteNode(nil->prev);
      |                   ^~~~
a.cc: In function 'int main()':
a.cc:81:9: error: 'deleteKey' was not declared in this scope; did you mean 'deletekey'?
   81 |         deleteKey(key); nd++;
      |         ^~~~~~~~~
      |         deletekey
a.cc:87:3: error: 'printfList' was not declared in this scope; did you mean 'printList'?
   87 |   printfList();
      |   ^~~~~~~~~~
      |   printList