void Display(Productptr t)
{
Productptr g;
g=t;
if(t==NULL)
cout<<"The list is empty."<<endl;
else
{
cout<<"Code\tDescription\tPrice\n";
cout<<"====\t===========\t=====\n";
while(g!= NULL)
{
cout<<g->code<<"\t"
<<g->description<<"\t\t"
<<g->price<<endl;
}
cout<<"End of the list"<<endl;
}
system("pause");
}
This code give me problem.
When I show 1st time is ok.
After 1st time I add something or delete something it will shown repeated 1st node that I insert.After that I cannot get back the normal already.
Any one can explain and solve it??
Text file I also get the same problem.
When I add or delete something in function cannot work normal agian.
The picture down show my problem.