Redifinition of functions in derived class
<p>In C++ primer plus it is written that</p>

<p>"If you redefine just one version of function in derived class, the other functions of base class  become hidden and cannot be used by objects of the derived class."</p>

<p>Then why does this code call fun1() ,as it should be hidden for the derived class object i.e. obj.</p>

<pre><code>#include&lt;iostream&gt;
using namespace std;
class base
{
    public:
      void fun1()
    {
    cout&lt;&lt;"base"&lt;&lt;endl;

       }
        void fun2(int a)
       {
           cout&lt;&lt;"function2";
       }
};
class derived :public base
{
public:
 void fun2()
       {
           cout&lt;&lt;"fun2";
       }

   };

int main()
{
 derived obj;
 obj.fun1();
 }
</code></pre>
