 <pre><code>class Grand_Son:public Son { public: ---^^^^^^^ void foo() { cout&lt;&lt;"\nFunction foo From Grand_Son\n"; } }; </code></pre> <p>You haven't declared <code>foo</code> public - I added it above. </p>