I have a function pointer that I am trying to pass along to a class method, where pthread_create will be invoked to pass along that parameter. But I am getting some errors and not sure where I am suppose to go from here.
void (*FuncPointer)(void*);
FuncPointer = random_function;
ThreadPool.Task(FuncPointer);
int IOThreadPool::Task(void* (*FuncPointer)(void*))
{
pthread_t NewThread;
int rc = pthread_create(&NewThread, NULL, FuncPointer, (void *) (intptr_t) IOThreadPool::Threads.size() + 1);
main.cpp:57:29: error: invalid conversion from ‘void* (*)()’ to ‘void (*)(void*)’ [-fpermissive]
Please explain why even though I am passing it as void* (*)(void*), I get void* (*)(). I am very confused and my head has begun to hurt!
Thanks