HELLP!

Hello everyone ! Can you make me a program? Pop and Push. Please !
No. Do your own homework.

We can help, but you need to have some code we can help with.
//Apolo, Catherine D.
//Caballero, Alvin B.
//Dasalla, Justin Roi G.
//Cansicio, Riza Mae c.
//San Pedro, Rachelle Jayra
#include<iostream>
#include<conio.h>
#include<iomanip>
using namespace std;

struct listnode
{
int num;
listnode *next,*prev;
}*headptr, *thisptr, *tailptr;

void push();
void pop();
void viewnode();

main()
{

int choice,temp;
cout<<setiosflags(ios::fixed|ios::showpoint|ios::right)<<setprecision(2);
cout<<endl;
do
{

cout<<endl<<endl;
cout<<setw(35)<<"* M E N U *"<<endl<<endl;
cout<<setw(37)<<"---------------"<<endl;
cout<<setw(24)<<"| "<<"[1] ADD "<<" |"<<endl;
cout<<setw(24)<<"| "<<"[2] DELETE "<<"|"<<endl;
cout<<setw(24)<<"| "<<"[3] VIEW "<<" |"<<endl;
cout<<setw(24)<<"| "<<"[4] EXIT "<<" |"<<endl;
cout<<setw(37)<<"---------------"<<endl<<endl;
cout<<setw(40)<<"Enter your choice: ";
cin>>choice;
system("cls");
switch(choice)
{
case 1:
push();
break;
case 2:
pop();
break;
case 3:
viewnode();
break;
case 4:
cout<<"\nPress any key to exit...";
getch();
break;
default: cout<<"\nINVALID INPUT";
}
}while(choice!=4);
return 0;
}


void viewnode()
{
if(headptr==NULL)
cout<<"\nThe Stack is Empty! ";
else
{
cout<<"\nStack List : ";
thisptr=headptr;
while(thisptr!=NULL)
{
cout<<thisptr->num<<" ";
thisptr= thisptr->next;
}
}
}

void push()
{
int num;
cout<<"\nEnter a Number: ";
cin>>num;

if(headptr==NULL)
{
headptr = new listnode;
headptr->num = num;
headptr->next = NULL;
}

else
{
tailptr = new listnode;
tailptr->num = num;
tailptr->next =NULL;

thisptr = headptr;

while(thisptr->next!=NULL)
thisptr = thisptr->next;

thisptr->next = tailptr;
}
cout<<"\nNODE ADDED!";
}

void pop()
{
if (tailptr==NULL)
{
cout<<"\nThe Stack is Empty!";
}
else if(tailptr->prev==NULL)
{
cout<<"\nThe Deleted Value is "<<tailptr->num;
delete tailptr;
tailptr=NULL;
}
else
{
cout<<"\nThe deleted value is "<<tailptr->num;
thisptr=tailptr;
tailptr=tailptr->prev;
delete thisptr;
thisptr=NULL;
}
}

I input three number ex. 4 3 2 and then delete a number which is 2, my error is when i'm going in the viewing the nodes! can you guys help me ?
Topic archived. No new replies allowed.