First down here is a part of my linklist which consists out of a data type
of class bunny which has its own functions.
"
private:
int counter;
struct node{
bunny x;
node *next;
} *p;"
And when I try to use the display function in the linklist I get compilation errors. Something is wrong with the line "std::cout<<"\n"<<q->x.display();"... Why cant I write like this? I know its that line becuase when I take it
away it compiles without problems. (Note also the simple display function for the bunny class below)
//DISPLAY FUNCTION IN LINKLIST CLASS
void linklist::display(){
node *q;
std::cout<<std::endl;
for(q=p; q != NULL; q=q->next){
std::cout<<"\n"<<q->x.display();
}
}
//DISPLAY FUNCTION IN BUNNY CLASS
void bunny::display(){
std::cout<<sex<<"\n";
std::cout<<name<<"\n";
std::cout<<color<<"\n";
std::cout<<radioactive_mutant_vampire_bunny<<"\n";
}