The problem is in your add function. Your first is realy your last link. Every time you add something, a new first is created ,so its next doesn't point anywhere and you cannot trace back your list. What you need to do is first->next = newlink; instead. Then set newlink->next to 0. Otherwise your show() loop will never terminate.
Hope this helps
void linklist::add(int d)
{
link* newlink=new link;
newlink->data=d;
newlink->next=NULL;// now we created a new one we need to attach it
if(first==NULL) // for the very first time
{
first=newlink;
}else
{// when it comes here we have few links in the list
// there are two options we can add the newlink at the begining
// or at the end of the list
// add newlink at begining so the last one will be the head
newlink->next=first; // keep the avaialable list as next
first=newlink; // make the first point to the newly created
/*
// add at the end, first will be the head always
// iterate through the first find out the last one
link* temp=first;
while(temp->next != NULL)
{
temp=temp->next;
}
// we are in the last one
temp->next=newlink;
*/
}
}