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;
void *foo(void *i) { int a = *((int *) i); free(i); } int main { int *arg = (char*)malloc(sizeof(char)) pthread_create(&thread, 0, foo, arg); }