So I have this
void* tf(void* p);
which I dont totally understand. What I think it is, is a function pointer with a void pointer for a parameter. I am using it to make a thread like this:
pthread_create( &thread_id[i], NULL, tf, NULL );
What I need is an expliation of tf and how to pass a parameter to it.
I have the function defined as
void* tf(void* p)
{
//I would like to use p here but dont know how.
}
This function is outside the main and needs to get a few other parameters that are set inside main. I have tried making it look like this tf(int i) but I then get a segment fault. So I know I am doing something wrong and need some help figuring it out.
Thanks for any help in this mater.
Jason