void display_list()
{
shoes_node *current_ptr;
current_ptr = head_ptr; // move current_ptr to head of list
if(current_ptr == NULL)
{
cout<<"\n\t\t\tNO RECORDS TO BE DISPLAY \n"<<endl;
}
else(current_ptr != NULL);
{
cout<<"\n\t\t\t ****************************\n"<<endl;
cout<<"\n\t\t\t SHOES RECORDS \n"<<endl;
cout<<"\n\t\t\t ****************************\n"<<endl;
do
{
cout<<"\n\t\t\t SHOES'S ID : "<<current_ptr->idkasut<<endl;
cout<<"\n\t\t\t SHOES'S BRAND : "<<current_ptr->jenama<<endl;
cout<<"\n\t\t\t SHOES'S PRICE : "<<current_ptr->harga<<endl;
cout<<"\n\t\t\t SHOES'S SIZE : "<<current_ptr->saiz<<endl;
cout<<endl;
current_ptr = current_ptr->next; //set current ptr to next node
}
while (current_ptr->next != NULL); //loop until the end of list
}
}
This code give me problem.
When I display for the 1st time is ok.
After I add the records more than 2 or 3 the program will stop automatically.
Any one can explain and solve it??