我有一个接受函数指针的函数,如果指针指向的函数返回,我想存储返回值,否则只运行函数。如下所示: static void threadStart(void (*function)(void*), void* arg) {if(function does not return void) (void*) stor
我有这个空函数,有一个指向线程的指针。当我去编译时,我会收到这样的警告:“控件到达非空函数的末尾”。如果我做了我将解决编译器给出的警告,但是得到一个新的警告,它说:
TA.c:50:2: warning: passing argument 3 of‘pthread_create’ from incompatible pointer type [enabled by
class foo void read(void (*func)(obj&)) // many things happen to obj...func)(obj); // Calls the function pointer to the handler.class bar : public foo voidhandler(obj&) // };