I am trying the delete all the elements in a linked list in the beginning.
I used the following code, it seems like that it complied fine with ./a.out,
however, when I use valgrind ./a.out, it says there are memory errors.
Could you help me to fix the problem please?
cout << "inside function emptyTheList() ";
cout <<"starting to traverse list to delete nodes"<<endl;
cout<<"there is no elements in the list" <<endl;
DR *temp1;//DR is a class
} //END function emptyTheList()