By looking at your fnct's, I dont think you have really grasped the concept of templates.
The purpose of a template is that the type of data the fnct receives is unkown. You are working with objects and a object can contain anything inside of it. For example:
Code:
template <class T>
void SLList<T>::makeLink (const T &nData)
{
if (head==NULL)
{
head=new SLList<T>;
head->nodeData=nData;
head->next=NULL;
tail=head;
}
else
{
tail->next=new SLList<T>;
tail=tail->next;
tail->nodeData=nData;
tail->next=NULL;
}
}
will create a linked list and fill it, but the important thing to note is that it is receiving nData which is an object that can contain data of any type e.g. char, int, float and maybe even all of them.
Code:
void List<Object>::displayBook(char* type) <--- type known
void SLList<T>::makeLink (const T &nData) <--- type unknown
Back to your question, by creating a proper template linked list class you will be able to retrieve information from the one function. I think you should seriously re-think your strategies and try to implement the class as a template.
One more thing....pls use code tags around your code. It makes it alot easier to read and understand.
Sophie