What is the difference between the two methods?
Sometimes when I get compile-time errors complaining that the compiler does not recognize some class types in functi
The compiler must know the type of the function parameter. Since you obviously don't provide a definition for example by including the header of Client
you have to provide a forward declaration. That is what you do in the second example (in an unusual way), so the compiler knows, that Client is a class. Since you only use a Pointer, the declaration is enough and you don't need the definition at this point.