To display the data
from singly link list
Here is a function to
display data from single link list
void show()
{
link *temp;
temp= first;
cout<<"The list
follows:"<<endl<<endl;
while(temp!=NULL)
// move towards null
{
cout<<temp->data<<"
";
temp=temp->next; // same as increment
statement as it moves toward null
}
}