thanks that solved the problem, you mean to write "{ cout<<number.m_Number; return os; }", now have a different error, do you have any idea what it might be:
Error 1 error LNK2001: unresolved external symbol "public: virtual void __thiscall Number::printNumber(void)" (?printNumber@Number@@UAEXXZ) C:\Users\Edward\Documents\Visual Studio 2012\Projects\ex3.1\ex3.1\IntLinkedList.obj ex3.1 ?
You use both printNumber() and operator<< to print the number. I think the reason you have printNumber() is because it can be virtual but operator<< can't be virtual. To be able to use printNumber in operator<< correctly you could let printNumber() take an ostream as argument and pass os from operator<<. If you do that you don't need to overload operator<< for all classes derived from Number.
Error 1 error LNK2001: unresolved external symbol "public: virtual void __thiscall Number::printNumber(void)" (?printNumber@Number@@UAEXXZ) C:\Users\Edward\Documents\Visual Studio 2012\Projects\ex3.1\ex3.1\IntLinkedList.obj ex3.1 ?
This is because you have not implemented the Number::printNumber(). If you don't want to do that, and not be able to have instances of Number, you can declare the function as pure virtual. virtualvoid printNumber() = 0;
It recognise Int::printNumber() all right. It is Number::printNumber() it complains about. If you don't want to provide an implementation for Number::printNumber() you have to declare it pure virtual.