So this is probably going to seem like an obviously simple question. I'm working on a basic project involving linked lists. I have a single link linked-list, within this linked list I have a pointer to an dynamically allocated Object I'd like to be printed, currently I keep getting rubbish data values, I've tested the overloaded insertion stream operator with my objectData class, and it works fine.
this small bit is in a printAll function, within the list class I have, I'm assuming this bit is my main problem
void objectData::printAll(){
if(head==0){
return;
}
Linknode *temp=head;
while(temp){
std::cout << temp->objectData << std::endl;
temp=temp->next;
}
}
so. how should I access what the objectData is pointing to, to print to screen
any help would be much appreciated. Any extra code can be provided if needed, thanks