警告:指针类型不兼容?

时间:2010-12-01 06:53:19

标签: c pthreads

嗨,我收到以下警告请帮助我。

  

传递'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;;
}

2 个答案:

答案 0 :(得分:5)

function必须返回void *。有关详细信息,请参阅pthread_create(3)手册页。

答案 1 :(得分:2)

来自manual

function必须接收并返回void *