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
In this case
void recv(Client * c)
Compiler looks for declaration of Client
. If it cannot find, it will give error. You can solve it by forward declaration as shown following
class Client;
void recv(Client * c)
Although I have never seen second case, but it looks like that is also declaring class Client here.