Sometimes, you may have a situation when you need to use a class which is not defined yet. For example, class A should know about B, and class B should know about A.
class A;
class B;
class A
{
B* pB;
};
class B
{
A* pA;
};
This code is equivalent to that:
class A
{
class B* pB;
};
class B
{
class A* pA; // it is not necessary to use class keyword here cause class A has already defined
};