I'm a begginer in C++ and trying to create a new instance of a class
foo* a= new foo(1);
*(a).kCreateThread();
and I get the following error
error C2228: left of '.kCreateThread' must have class/struct/union
What is wrong?
I'm a begginer in C++ and trying to create a new instance of a class
foo* a= new foo(1);
*(a).kCreateThread();
and I get the following error
error C2228: left of '.kCreateThread' must have class/struct/union
What is wrong?
What you wrote is equivalent to
*((a).kCreateThread());
You should use
a->kCreateThread();
or
(*a).kCreateThread();
These last two are equivalent.