I simply want to pass the value of an integer to a thread.
How can I do that?
I tried:
int i; pthread_t thread_tid[10]; for(i=0;
int is 32 bit, and void * is 64 bit in 64bit Linux; In that case you should use long int instead of int;
long int i; pthread_create(&thread_id, NULL, fun, (void*)i);
int fun(void *i) function
long int id = (long int) i;