Basically the problem goes like this...
I have a parent class called Head, and a derived class ( from Head ) called Arms.
Head *MyHead; // Pointer
Arms MyArms;
I have overloaded the operator << to handle file output, so when I do "outfile << MyArms", it is supposed to output it's variables into whatever outfile is.
MyHead = &MyArms;
Now I need to use the same overloaded operator ( << ) on MyHead, but what it outputs is the memory address of MyArms, instead of what is specified in the code of the overloaded << ( which is supposed to output its variables ).
Any help will be greatly appreciated, thank you!



LinkBack URL
About LinkBacks



I used to be an adventurer like you... then I took an arrow to the knee.