and for choice-->2
Code:
void insafter(){ //I assume user inputs this option after he has made a list, no condition check for empty list
int x, added_item;
printf("Enter the information of the node after which you want to insert your new node\n");
scanf("%d", &x);
getchar();
temp = head;
while(temp!=NULL){
if (temp->info==x) break;
temp= temp->next;
}//now we have the node temp after which we insert our node
if (temp==NULL){
printf("\n the value was not found in the list!\n");
return;
}
printf("Enter item to be added\n");
scanf("%d", &added_item);
getchar();
struct dll *p;
p=(struct dll *)malloc(sizeof(struct dll));
p->info = added_item;
p->next = temp->next;
p->prev = temp;
temp->next = p;
}