I've to class:
class A
{
public:
void start();
void stop();
void calling_function();
}
class B
{
public:
void foo(void (*start)(), void (*stop)());
}
This may seem stupid, but those are C program part transformed in classes.
My question is:
Before, only class B exist, and this work nice, the void (*start)() and void (*stop)() declaration work well when I was doing:
calling_function()
{
B.foo(start, stop) // at this time stop and start weren't class methode, but "wandering" function.
}
But now, this create an exception when I call
A::Calling_function()
{
B.foo(start, stop) // at this time stop and start weren't class methode, but "wandering" function.
}
Error:
error C2664: 'foo' : cannot convert parameter 1 from 'void (void)' to 'void (__cdecl *)(void)'
None of the functions with this name in scope match the target type
Many thanks to those who understand what I mean
class A
{
public:
void start();
void stop();
void calling_function();
}
class B
{
public:
void foo(void (*start)(), void (*stop)());
}
This may seem stupid, but those are C program part transformed in classes.
My question is:
Before, only class B exist, and this work nice, the void (*start)() and void (*stop)() declaration work well when I was doing:
calling_function()
{
B.foo(start, stop) // at this time stop and start weren't class methode, but "wandering" function.
}
But now, this create an exception when I call
A::Calling_function()
{
B.foo(start, stop) // at this time stop and start weren't class methode, but "wandering" function.
}
Error:
error C2664: 'foo' : cannot convert parameter 1 from 'void (void)' to 'void (__cdecl *)(void)'
None of the functions with this name in scope match the target type
Many thanks to those who understand what I mean