Just looking at the code for display, I'm surprised it doesn't crash.
void doubly::display()
{
node *temp;
temp=head;
while(temp!=NULL)
{
cout<<temp->data<<"\t";
temp=temp->next;
}
cout<<"\n";
cout<<"\nnow printing in reverse order";
while(temp->prev!=NULL)
{
cout<<temp->data<<"\t";
temp=temp->prev;
}
}
When you quit the first loop, temp will be NULL, as per the loop condition. Then when you try to start the second loop, you'll be accessing invalid memory trying to dereference NULL (and should crash). You'll can change the first loop to go until temp->next == NULL
or you can keep a tail pointer in addition to the head one (where tail would record the last node in the list).
Side notes:
- <iostream.h> is deprecated. Use <iostream> and the std:: namespace in the future.
- <conio.h> is compiler specific and most people here would not be able to run your code.
- Why do you need <process.h>? Unless I missed something...
- Please use [code] and [/code] tags when you post code on the forums, as it preserves formatting (especially indentation) ;)