Language: C++

#include <iostream>
#include <cstdlib>
#include <string>
#include <stdio.h>



using namespace std;

typedef struct anode
{
	node *next;
	node *prev;
	int num;
}node;



node* nodemalloc()
{
	return (node *)malloc( sizeof(node) );
}

node *head, *tail;


void initialize()
{
	
	head = nodemalloc();
	tail = nodemalloc();
		head->next = tail;

		tail->prev = head;
}


void insert(int m)
{
	node *p = nodemalloc();

	p->num = m;
	p->next = head->next;
	head->next->prev = p;
	p->prev = head;
	head->next = p;


	//cout << "p-> = " << p->num << "   " << "p->prev->num = " << p->prev->num << "\n";
	//cout << "p->next->prev->num = " << p->next->prev->num << "\n";
}

void del(node *p)
{
	p->prev->next = p->next;
	p->next->prev = p->prev;

	/*cout << "p->num = " << p->num << "\n";
	cout << "p->prev =" << p->prev->num << "\n";
	cout << "p->prev->next =" << p->prev->next->num << "\n";
	*/
	free(p);
}

void deletefirst()
{
	head->next->next->prev = head;
	free(head->next);
	head->next = head->next->next;
}

void deletelast()
{
	tail->prev->prev->next= tail;
	free(tail->prev);
	tail->prev = tail->prev->prev;
}

int main()
{
	node *pp;
	int n,key;
	char str[15];

	pp = nodemalloc();

	initialize();

	scanf("%d", &n);

	for(int i = 0; i < n; i++)
	{
		scanf("%s", str);

		if (str[6] == 'F')
		{
			deletefirst();

		}else if (str[6] == 'L')
		{
			deletelast();

		}else
		{
			scanf("%d", &key);

			if (str[0] == 'i')
			{
				insert(key);

			}else if (str[0] == 'd')
			{
				pp = head->next;

				while(1)
				{
					//cout << "p=" << p->num << "\n";
					if (pp->num == key)
					{
						del(pp);
						break;
					}
					pp = pp->next;
				}
			}
		}

	}

	//cout << "ok3\n";

	pp = head->next;

	while(1)
	{
		if (pp->next != tail)
		{
			cout << pp->num << " ";
		}
		else if (pp->next == tail)
		{
			cout << pp->num << "\n";
			break;
		}
		pp = pp->next;
	}

	//cout << "ok4\n";


	return 0;
}

Compiler output:
a.cc:12:9: error: 'node' does not name a type; did you mean 'anode'?
   12 |         node *next;
      |         ^~~~
      |         anode
a.cc:13:9: error: 'node' does not name a type; did you mean 'anode'?
   13 |         node *prev;
      |         ^~~~
      |         anode
a.cc: In function 'void initialize()':
a.cc:32:23: error: 'node' {aka 'struct anode'} has no member named 'next'
   32 |                 head->next = tail;
      |                       ^~~~
a.cc:34:23: error: 'node' {aka 'struct anode'} has no member named 'prev'
   34 |                 tail->prev = head;
      |                       ^~~~
a.cc: In function 'void insert(int)':
a.cc:43:12: error: 'node' {aka 'struct anode'} has no member named 'next'
   43 |         p->next = head->next;
      |            ^~~~
a.cc:43:25: error: 'node' {aka 'struct anode'} has no member named 'next'
   43 |         p->next = head->next;
      |                         ^~~~
a.cc:44:15: error: 'node' {aka 'struct anode'} has no member named 'next'
   44 |         head->next->prev = p;
      |               ^~~~
a.cc:45:12: error: 'node' {aka 'struct anode'} has no member named 'prev'
   45 |         p->prev = head;
      |            ^~~~
a.cc:46:15: error: 'node' {aka 'struct anode'} has no member named 'next'
   46 |         head->next = p;
      |               ^~~~
a.cc: In function 'void del(node*)':
a.cc:55:12: error: 'node' {aka 'struct anode'} has no member named 'prev'
   55 |         p->prev->next = p->next;
      |            ^~~~
a.cc:55:28: error: 'node' {aka 'struct anode'} has no member named 'next'
   55 |         p->prev->next = p->next;
      |                            ^~~~
a.cc:56:12: error: 'node' {aka 'struct anode'} has no member named 'next'
   56 |         p->next->prev = p->prev;
      |            ^~~~
a.cc:56:28: error: 'node' {aka 'struct anode'} has no member named 'prev'
   56 |         p->next->prev = p->prev;
      |                            ^~~~
a.cc: In function 'void deletefirst()':
a.cc:67:15: error: 'node' {aka 'struct anode'} has no member named 'next'
   67 |         head->next->next->prev = head;
      |               ^~~~
a.cc:68:20: error: 'node' {aka 'struct anode'} has no member named 'next'
   68 |         free(head->next);
      |                    ^~~~
a.cc:69:15: error: 'node' {aka 'struct anode'} has no member named 'next'
   69 |         head->next = head->next->next;
      |               ^~~~
a.cc:69:28: error: 'node' {aka 'struct anode'} has no member named 'next'
   69 |         head->next = head->next->next;
      |                            ^~~~
a.cc: In function 'void deletelast()':
a.cc:74:15: error: 'node' {aka 'struct anode'} has no member named 'prev'
   74 |         tail->prev->prev->next= tail;
      |               ^~~~
a.cc:75:20: error: 'node' {aka 'struct anode'} has no member named 'prev'
   75 |         free(tail->prev);
      |                    ^~~~
a.cc:76:15: error: 'node' {aka 'struct anode'} has no member named 'prev'
   76 |         tail->prev = tail->prev->prev;
      |               ^~~~
a.cc:76:28: error: 'node' {aka 'struct anode'} has no member named 'prev'
   76 |         tail->prev = tail->prev->prev;
      |                            ^~~~
a.cc: In function 'int main()':
a.cc:113:44: error: 'node' {aka 'struct anode'} has no member named 'next'
  113 |                                 pp = head->next;
      |                                            ^~~~
a.cc:123:50: error: 'node' {aka 'struct anode'} has no member named 'next'
  123 |                                         pp = pp->next;
      |                                                  ^~~~
a.cc:132:20: error: 'node' {aka 'struct anode'} has no member named 'next'
  132 |         pp = head->next;
      |                    ^~~~
a.cc:136:25: error: 'node' {aka 'struct anode'} has no member named 'next'
  136 |                 if (pp->next != tail)
      |                         ^~~~
a.cc:140:30: error: 'node' {aka 'struct anode'} has no member named 'next'
  140 |                 else if (pp->next == tail)
      |                              ^~~~
a.cc:145:26: error: 'node' {aka 'struct anode'} has no member named 'next'
  145 |                 pp = pp->next;
      |                          ^~~~