Dear all,
In the menu, I can add members in a memberlist and display them, using the function :
template<class Object>
void List<Object>::displayElement(char* type)
{
if (num_elements == 0)
cout<<"No "<<type<<" is found in the "<<type<< "array.\n";
else
for(int element=0; element<this->num_elements; element++)
{
cout<<'\n';
this->element_list[element]->display(association_list.get_member(element_list[element]));
}
}
The problem is that I want to use the same function to display also the books, but there is a problem about the type of the argument of get_member() function. That function accepts only class Book* argument and not class Member* argument. The latter one is necessary to display the books.
How can I avoid this problem and use the same function to display both the books and members without any problems?
If code is required to answer my question, let me know about it.
Regards,
grscot
In the menu, I can add members in a memberlist and display them, using the function :
template<class Object>
void List<Object>::displayElement(char* type)
{
if (num_elements == 0)
cout<<"No "<<type<<" is found in the "<<type<< "array.\n";
else
for(int element=0; element<this->num_elements; element++)
{
cout<<'\n';
this->element_list[element]->display(association_list.get_member(element_list[element]));
}
}
The problem is that I want to use the same function to display also the books, but there is a problem about the type of the argument of get_member() function. That function accepts only class Book* argument and not class Member* argument. The latter one is necessary to display the books.
How can I avoid this problem and use the same function to display both the books and members without any problems?
If code is required to answer my question, let me know about it.
Regards,
grscot