Quote Originally Posted by imranhabib1 View Post
2. we have to call constructor of the class , (the same class whose member function we are calling) in our .cpp
This is not true.
3. adding refernce to .h file
What do you mean by "reference to .h file"?
I did 1 and 3 .. but i am confused about doing 2 ... because it has no default constructor I mean constructor with out parameters and its other constructor eg AgentActioncomponent(GameEntity* ABC)
can be used or not in my .cpp
None of what you stated makes sense.

Here is an example of code where 2) is not necessary:
Code:
#include <string>

size_t foo(std::string& s)
{
    return s.length();
}
Where do you see a default constructor being called for s? That code will compile just fine. As for 3) in your description, I have no idea what you're referring to.

Regards,

Paul McKenzie