C++ method only visible when object cast to base class? <p>It must be something specific in my code, which I can't post. But maybe someone can suggest possible causes.</p> <p>Basically I have:</p> <pre><code>class CParent { public: void doIt(int x); }; class CChild : public CParent { public: void doIt(int x,int y,int z); }; CChild *pChild = ... pChild-&gt;doIt(123); //FAILS compiler, no method found CParent *pParent = pChild; pParent-&gt;doIt(123); //works fine </code></pre> <p>How on earth?</p> <p>EDIT: people are talking about shadowing/hiding. But the two versions of doIt have different numbers of parameters. Surely that can't confuse the compiler, overloads in child class which can't possibly be confused with the parent class version? Can it?</p> <p>The compiler error I get is: <strong>error C2660: 'CChild::doIt' : function does not take 1 argument</strong></p>