Doubly Linked List C++ Programming

Illustration Figure
#include<iostream>
using namespace std;

typedef struct DlinkNode{
int data;
struct DlinkNode *llink;
struct DlinkNode *rlink;
}DlinkNode;

int get_a_cmd();
void Dinsert(DlinkNode *phead);
void Ddeleted(DlinkNode *phead);
void Dshow(DlinkNode *phead);
void Dsearch(DlinkNode *phead);
void init(DlinkNode *phead);

int main(){

DlinkNode head;
init(&head);

int cmd;
do{
cmd=get_a_cmd();
switch(cmd){
case 1: Dinsert(&head);break;
case 2: Ddeleted(&head);break;
case 3: Dshow(&head);break;
case 4: Dsearch(&head);break;
default:break;
}
}while(cmd!=5);
return 0;
}
int get_a_cmd(){
int n;
cout<<endl<<endl;
cout<<"---- Menu ----"<<endl;
cout<<"1. Insert. "<<endl;
cout<<"2. Delete. "<<endl;
cout<<"3. Show. "<<endl;
cout<<"4. Search. "<<endl;
cout<<"5. Exit. "<<endl;
cout<<"Select one: ";
cin>>n;
return n;
}

void init(DlinkNode *phead){
phead->llink=phead;
phead->rlink=phead;
}

void Dinsert(DlinkNode *phead){
DlinkNode *new_node = (DlinkNode *)malloc(sizeof(DlinkNode));

if(!new_node){
cout<<"The memory is full.";
exit(1);
}

int item;
cout<<"Put a value: ";
cin>>item;
(new_node)->data=item;

new_node->llink=phead;
new_node->rlink=phead->rlink;
phead->rlink->llink=new_node;
phead->rlink=new_node;
}

void Ddeleted(DlinkNode *phead){
DlinkNode *deleted = phead->rlink;
if(deleted!=phead){
deleted->llink->rlink=deleted->rlink;
deleted->rlink->llink=deleted->llink;
}else{
cout<<"List is empty."<<endl;
return;
}

cout<<"Delete success.";
}

void Dshow(DlinkNode *phead){
DlinkNode *p = phead;
do{
p=p->rlink;
cout<<p->data<<"   ";
}while(p->rlink!=phead);
}

void Dsearch(DlinkNode *phead){
int value, success=0;
cout<<"Put what you search: ";
cin>>value;
DlinkNode *p = phead;
do{
p=p->rlink;
if(p->data==value)
success=1;
}while(p->rlink!=phead);
if(success>0)
cout<<"Search success.";
else
cout<<"Search failed.";
cout<<endl;
}