【发布时间】:2010-11-24 01:23:00
【问题描述】:
pthread_create 的函数头如下所示:
int pthread_create(pthread_t * thread,
const pthread_attr_t * attr,
void * (*start_routine)(void *),
void *arg);
除了start_routine 的函数指针是void* (*fpointer) (void*) 的形式,这意味着它接受void* 并返回void*,我完全理解。
void* 参数只是将参数传递给start_routine 的一种方式,我明白了那部分,但我不明白为什么函数返回void*?什么代码甚至会注意到该返回值?
【问题讨论】: