I have a class like::
Class Test
{
public:
void Check(){//dosomething};
static void call(){//I want to call check()};
};
Because call() is a static member, so it can’t call non-static functions, so I think to use Check() in call() is to create Test pointer and then point to Check(), but I think it is not good, is there a better way to do this?
I can rewrite all of things in the static function, so I don’t need to call Check() again, but what I want is to reuse the code in Check() and avoid repeated code.
Since you need an instance, you either have to create one, use a static instance, or pas it to
call():