Ask Your Question

Revision history [back]

declare the instance as pointer variable to the class member, and use the new to create the instance whenever it is required in the class.

for example:

class AC{

ActionClient ac_;

AC(string name) {

ac_= new ActionClient(name, true);

} };

make sure you clear the pointer after use. I am beginner too. please correct if I have any mistakes.