Language: C

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

typedef struct Nodes
{
	int nKey;
	Nodes* pNext, *pPrev;
}Node;

Node* pNul;

void Init()
{
	pNul = (Node*)malloc(sizeof(Node));
	pNul->pNext = pNul;
	pNul->pPrev = pNul;
}

void insert(int key)
{
	Node* pCur = (Node*)malloc(sizeof(Node));
	pCur->nKey = key;
	pCur->pNext = pNul->pNext;
	pCur->pNext->pPrev = pCur;
	//changed
	pCur->pPrev = pNul;
	pNul->pNext = pCur;
}

Node* listSearch(int key)
{
	Node* pCur = pNul->pNext;
	while (pCur->nKey != key && pCur->pNext != pNul)
	{
		pCur = pCur->pNext;
	}
	return pCur;
}

void printList()
{
	Node* pCur = pNul->pNext;
	int nIndex = 0;
	while (pCur != pNul)
	{
		if (0 != nIndex)
		{
			printf(" ");
		}
		printf("%d", pCur->nKey);
		++nIndex;
		pCur = pCur->pNext;
	}
	printf("\n");
}

void deleteNode(Node* p)
{
	p->pNext->pPrev = p->pPrev;
	p->pPrev->pNext = p->pNext;
	p->pNext = p;
	p->pPrev = p;
	free(p);
}

void deleteFirst()
{
	deleteNode(pNul->pNext);
}

void deleteLast()
{
	deleteNode(pNul->pPrev);
}

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

int main()
{
	char cod[20];
	int nkey, n;
	scanf("%d", &n);
	Init();
	for (int i = 0; i < n; ++i)
	{
		scanf("%s", cod);
		if ('i' == cod[0])
		{
			scanf("%d", &nkey);
			insert(nkey);
		}
		else if (6 < strlen(cod))
		{
			if ('L' == cod[6])
			{
				deleteLast();
			}
			else if ('F' == cod[6])
			{
				deleteFirst();
			}
		}
		else
		{
			scanf("%d", &nkey);
			deleteKey(nkey);
		}
	}
	printList();
	return 0;
}


Compiler output:
main.c:8:9: error: unknown type name 'Nodes'
    8 |         Nodes* pNext, *pPrev;
      |         ^~~~~
main.c: In function 'Init':
main.c:16:21: error: assignment to 'int *' from incompatible pointer type 'Node *' {aka 'struct Nodes *'} [-Wincompatible-pointer-types]
   16 |         pNul->pNext = pNul;
      |                     ^
main.c:17:21: error: assignment to 'int *' from incompatible pointer type 'Node *' {aka 'struct Nodes *'} [-Wincompatible-pointer-types]
   17 |         pNul->pPrev = pNul;
      |                     ^
main.c: In function 'insert':
main.c:25:20: error: request for member 'pPrev' in something not a structure or union
   25 |         pCur->pNext->pPrev = pCur;
      |                    ^~
main.c:27:21: error: assignment to 'int *' from incompatible pointer type 'Node *' {aka 'struct Nodes *'} [-Wincompatible-pointer-types]
   27 |         pCur->pPrev = pNul;
      |                     ^
main.c:28:21: error: assignment to 'int *' from incompatible pointer type 'Node *' {aka 'struct Nodes *'} [-Wincompatible-pointer-types]
   28 |         pNul->pNext = pCur;
      |                     ^
main.c: In function 'listSearch':
main.c:33:22: error: initialization of 'Node *' {aka 'struct Nodes *'} from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   33 |         Node* pCur = pNul->pNext;
      |                      ^~~~
main.c:34:49: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
   34 |         while (pCur->nKey != key && pCur->pNext != pNul)
      |                                                 ^~
main.c:36:22: error: assignment to 'Node *' {aka 'struct Nodes *'} from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   36 |                 pCur = pCur->pNext;
      |                      ^
main.c: In function 'printList':
main.c:43:22: error: initialization of 'Node *' {aka 'struct Nodes *'} from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   43 |         Node* pCur = pNul->pNext;
      |                      ^~~~
main.c:53:22: error: assignment to 'Node *' {aka 'struct Nodes *'} from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
   53 |                 pCur = pCur->pNext;
      |                      ^
main.c: In function 'deleteNode':
main.c:60:17: error: request for member 'pPrev' in something not a structure or union
   60 |         p->pNext->pPrev = p->pPrev;
      |                 ^~
main.c:61:17: error: request for member 'pNext' in something not a structure or union
   61 |         p->pPrev->pNext = p->pNext;
      |                 ^~
main.c:62:18: error: assignment to 'int *' from incompatible pointer type 'Node *' {aka 'struct Nodes *'} [-Wincompatible-pointer-types]
   62 |         p->pNext = p;
      |                  ^
main.c:63:18: error: assignment to 'int *' from incompatible pointer type 'Node *' {aka 'struct Nodes *'} [-Wincompatible-pointer-types]
   63 |         p->pPrev = p;
      |                  ^
main.c: In function 'deleteFirst':
main.c:69:24: error: passing argument 1 of 'deleteNode' from incompatible pointer type [-Wincompatible-pointer-types]
   69 |         deleteNode(pNul->pNext);
      |                    ~~~~^~~~~~~
      |                        |
      |                        int *
main.c:58:23: note: expected 'Node *' {aka 'struct Nodes *'} but argument is of type 'int *'
   58 | void deleteNode(Node* p)
      |                 ~~~~~~^
main.c: In function 'deleteLast':
main.c:74:24: error: passing argument 1 of 'deleteNode' from incompatible pointer type [-Wincompatible-pointer-types]
   74 |         deleteNode(pNul->pPrev);
      |                    ~~~~^~~~~~~
      |                        |
      |                        int *
main.c:58:23: note: expected 'Node *' {aka 'struct Nodes *'} but argument is of type 'int *'
   58 | void deleteNode(Node* p)
      |                 ~~~~~~^