title: Static object in struct
body: <p>I have class <code>A</code> with method <code>display()</code>. I create a struct <code>B</code> with a static variable of type object <code>A</code>:</p>
  
  <pre><code>class A{
  public :
      void display()
      {
          cout &lt;&lt; "in A " &lt;&lt; endl;
      }
  };
  typedef struct B{
      static A a;
  } bb;
  
  //B::a.display();
  int main() {
      bb b;
      bb::a.display();
      return 0;
  }
  </code></pre>
  
  <p>Now I get an error when try to access <code>a</code>. </p>
  
  <p>How can I define a static object in this case?</p>