Using pthreads

I found an example code that utilizes pthreads to do matrix multiplication. I wanted to run it to see exactly how it works but I am getting an error that I am not sure how to fix. The code is located at:

http://macboypro.com/blog/2009/06/29/matrix-multiplication-in-c-using-pthreads-on-linux/

I get an error at the command:

struct v *data = param;

located in the runner function. Anyone know how I can get this to work properly?

Thanks.

The problem that I am having is in this function:



void *multiply(void *param)
{

struct v *data = param;

int n;
int sum = 0;

for(n = 0; n < K; n++)
{
sum += A[data->i][n] * B[n][data->j];
}

C[data->i][data->j] = sum;


pthread_exit(0);

}


The error I get is:

invalid conversion from void* to v*

Thanks for any help.

You have to perform an explicit cast of the pointer.
Topic archived. No new replies allowed.