线程 pthread_create 的错误提示,不知为何
函数
void thread(void);
在main函数里面调用
ret=pthread_create(&id,&attr,(void *)thread,NULL);
编译的时候报错
main.c:56: error: invalid conversion from ‘void*’ to ‘void* (*)(void*)’
main.c:56: error: initializing argument 3 of ‘int pthread_create(pthread_t*, const pthread_attr_t*, void* (*)(void*), void*)’
是什么原因啊?