node *temp = new node;
temp->num = num;
temp->next = head; // if head was NULL, next will now be NULL (end of list)
head = temp;
return num;
}

//****remove at the head, this is stack, push at the head remove at the head.
char character:op(char num)
{
//int num;
node *temp = head;

if (temp == NULL) return -1;

num = temp->num;
head = temp->next;
delete temp;

return num;

//return success;
}

//this function will print from the beginning of the list to the end of the list
void character:rint()
{
//if the list was empty print out an error message
if(head==NULL)
{
cout << "There isn't any number" << endl;
return;
}

//else while not the end of the list, print out the number and go to the next one
else
{
cur=head;
while(cur!=NULL)
{
cout << "number: " << cur->num << endl;
cur=cur->next;
}
}
}

//the search function was search from the beginning of the head to the end of the
//head.
bool character::Isempty() const
{
return (head == NULL);
}