Hey,
I need help!!
I am working on this program and it has 4 classes:Member, GeneralizedList, sublist and an Integer class.
The Member class is an Abstract class with all abstract functions. The sublist and Integer class are derived classes of the Member class. the Sublist is also a derived class of the GeneralizedList.
I want to print what is in the linked list but instead I print the memory address, could someone tell me what I am doing wrong. here are the codes

Code:
class Member{
public:
	virtual void print(ostream & out)const = 0;
	virtual bool search(int a) = 0;
	virtual Member * copy() = 0;
	virtual ~Member(){}
};

typedef struct Node{
	Member * member;
	Node * next;
}Node;



#include "GeneralizedList.h"


GeneralizedList::GeneralizedList()
{
	size = 0;
	first = NULL;
	last = NULL;
	current = NULL;
}
GeneralizedList::GeneralizedList(const GeneralizedList &g)
{
	Node *temp;
	size = g.size;
	first = NULL;
	temp = g.first;
	while(temp != NULL)
	{
		if(first == NULL)
		{
			first = last = new Node;
			first = last = temp;
		}
		else
		{
			Node *aNode = new Node;
			aNode = temp;
			last->next = aNode;
			last = last->next;
		}
		temp = temp->next;
	}
}
const GeneralizedList & GeneralizedList:: operator =(const GeneralizedList& g)
{
	if(this != &g)
	{
		delete first; 
		delete last;
		size = g.size;
		Node* temp;
		temp = g.first;
		while(temp!=NULL)
		{
			if(first == NULL)
			{
				first = last = new Node;
				first = last = temp;
			}
			else
			{
				Node *aNode = new Node;
				aNode = temp;
				last->next = aNode;
				last = last->next;
			}
			temp = temp->next;
		}
	}
	return *this;
}
void GeneralizedList::print(ostream &out)const
{
	current = first;
	if(current !=NULL){
		out<<"(";
		while(current!=NULL)
		{
			if(current->next!= NULL)
				out << current->member<<", ";
			else
				out<<current->member;
			current = current->next;
		}
		out<<")\n";
	}
}
GeneralizedList::~GeneralizedList()
{
	Node *temp;
	while(first != NULL)
	{
		temp = first;
		first = first->next;
		delete temp;
	}
}
bool GeneralizedList::search(int a)
{
	//Integer *p = new Integer(a); 
	Node *temp = first;
	while (temp!=NULL)
	{
		if(temp->member->search(a))
			return true;
		temp = temp->next;
	}
	return false;
}
bool GeneralizedList::isEmpty()
{
	return (size == 0);
}
int GeneralizedList::get_size()
{
	return size;
}
void GeneralizedList::add(Member *p)
{
	if(isEmpty())
	{
		first = last = new Node;
		first->member = last->member = p;
		first->next = last->next = NULL;
	}
	else 
	{
		Node *aNode = new Node;
		aNode->member = p;
		aNode->next = NULL;
		last->next = aNode;
		last = last->next;
	}
	size++;
}
const Member& GeneralizedList::operator [](int index)const
{
	int count = 0;
	while(index < size)
	{
		Node *temp = first;
		if(count == index)
		{
			Member *p = temp->member;
			return *p;
		}
		temp = temp->next;
		count++;
	}
	// the index is more than the size
	cout<<"index is more than size\n";
	//Member garbage = NULL;
}
Member & GeneralizedList::operator [](int index)
{
	int count = 0;
	while(index < size)
	{
		Node *temp = first;
		if(count == index)
		{
			Member *p = temp->member;
			return *p;
		}
		temp = temp->next;
		count++;
	}
	// the index is more than the size
	cout<<"index is more than size\n";
}
ostream& operator<<(ostream& out, const GeneralizedList& g)
{
	g.print(out);
	return out;
}
If I can fix the generalizedlist problem I can do the same for the sublist.