2010-12-01 4 views
2

salut je reçois les pls d'avertissement suivants m'aider.avertissement: type de pointeur incompatible?

3 de passage d 'arguments « pthread_create » de type pointeur incompatible

mon code est:

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

      { 
       int bytes_recieved;; 
} 
+1

De quel type est l'argument 'connected'? –

Répondre

5

function doit retourner un void *. Voir la page de manuel pthread_create(3) pour plus de détails.

+0

Pour retourner un 'void *' à partir de 'function', vous pouvez appeler' pthread_exit (void *) 'n'importe où dans' function' que vous utiliseriez normalement 'return'. – Kevin

Questions connexes