c - 警告 :incompatible pointer type?

标签 c pthreads

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

passing argument 3 of ‘pthread_create’ from incompatible pointer type

我的代码是:

int function(int *);
int main()
{
         pthread_t thread_a;
pthread_create(&thread_a,NULL, function,&connected);
int function(int *fnd)

            {
                int bytes_recieved;;
}

最佳答案

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

关于c - 警告 :incompatible pointer type?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4321920/

相关文章:

c - 使用函数将文本文件读入结构数组

c++ - 当 C++ 线程退出时,内存是否保持分配状态?

linux - 为什么线程消息以相反的顺序出现?

c - GDB 与 pthreads

C 在《哲学家就餐》中将数组传递给 pthread

c - HMAC_Init_ex 损坏堆栈空间

c - 那么函数指针的*可以省略吗?

c - 如何正确地将小数扫描到字符

C - 一个程序可以为自己分配多少内存 - 它是如何确定的?

php - PHP-PTHREAD工作线程不同时执行