forward declaration of class
<p>In A.h I have the following class</p>

<pre><code>class A
{
  int a;
  char name[100];
}
</code></pre>

<p>B.h has the following code</p>

<pre><code>class A;
Class B
{
  public:
   int c;
   float d;
   getObjectDetails(A *);
};
</code></pre>

<p>I compiled it as <code>g++ A.h B.h B.cpp -o out</code>. But it gives compilation errors saying class A is incomplete. Could any one please help me understand?</p>

<p>Also, if I include header file A.h in B.h, everything goes fine. In that case, I need not declare Class A before Class B definition I think, I can directly create and use instance of class A. Could anyone clarify me on this point?</p>

<p>what happens in step "class A" declaration at compile time and run time?</p>
