嗨,我收到以下警告请帮助我。
传递'pthread_create'的参数3 来自不兼容的指针类型
我的代码是:
int function(int *);
int main()
{
pthread_t thread_a;
pthread_create(&thread_a,NULL, function,&connected);
int function(int *fnd)
{
int bytes_recieved;;
}
答案 0 :(得分:5)
function
必须返回void *
。有关详细信息,请参阅pthread_create(3)
手册页。
答案 1 :(得分:2)
来自manual:
function
必须接收并返回void *
。