title: "a struct has public inheritance by default"
body: <p>"a struct has public inheritance by default" what does this statement really mean? And why is the following code in error just because I have omitted the keyword 'public' while deriving the class d from c??</p>
  
  <pre><code>struct c 
  {
  protected:
      int i;
  public:
      c(int ii=0):i(ii){} 
      virtual c *fun();
  };
  
  c* c::fun(){
      cout&lt;&lt;"in c";
      return &amp;c();
  }
  
  class d : c
  {  
  public:
      d(){}
      d* fun()
      {
          i = 9;
          cout&lt;&lt;"in d"&lt;&lt;'\t'&lt;&lt;i;
          return &amp;d();
      }
  };
  
  
  int main()
  {
      c *cc;
      d dd;
      cc = &amp;dd;
      cc-&gt;fun();
  }
  </code></pre>