Overriding Private Members of Parent Class
<p>Given the following classes:</p>

<pre><code>class foo
{
private:
    int c;

public:
    foo( int a = 42 ) { c = a; }
    ~foo();
};

class bar: public foo
{
public:
    bar();
    ~bar();
};
</code></pre>

<p>How can I make <strong>bar</strong> override <strong>c</strong> with a different number? Can I do something like this?</p>

<pre><code>bar::bar() 
{
    c = 12;
}
</code></pre>

<p>I get this error when trying to compile:</p>

<blockquote>
  <p>test.cpp: In constructor <code>‘bar::bar()’</code>:<br>
  test.cpp:8:7: error: <code>‘int foo::c’</code> is private</p>
</blockquote>
