C++ errors in code
<p>I have this code (question from exam) and there are many errors in the code, here is the code:</p>

<pre><code> class A
 {
   int z;
   static int y;
   public:
     A() {(*this).incrementY();}
    int x () { y=y+2; return z;}
    static int getY(){ return z;}
    void incrementY() {y++}
 };
 class B: A
 {
   public:
    B (): A() {(*this).incrementY();};
 };
 class C : public B
 {
   public:
    C(): B() {(*this).incrementY;() }
 };

 int main()
 {
   A::x();
   A a;
   a.getY();
   A::getY();
   B b;
   C c;
   C::getY();
   b.x();
 }
</code></pre>

<p>There is a private inheritance. This means that all the methods and variables in B become private to any class that inherits from B? </p>
