In C, how can i pass more than one argument to a thread?
Normally, I do it in a way like,
pthread_create(&th,NULL,dosomething,(void*)connfd);
void
About passing an array as an argument, of course you can do that. If you declare an array as,
int a[3] = {1,2,2};
a is like a label to the starting address of the array. Thus a represents a pointer. *a is equal to a[0] and *(a+1) is equal to a[1]. So you can pass the array to the thread as below:
pthread_create(&th,NULL,dosomething,(void *)a);
Inside the thread you can cast a back to an int * and use as an array.