Background
I have a struct with two 2D arrays...
typedef struct v
{
int *b;
int *a;
} v;
Inside my main function I have...
int A [M][K] = {{2,2},{2,2}, {3,2} };
int B [K][N] = {{2,2,2},{2,2,2}};
struct v *data= (struct v *) malloc(sizeof(struct v));
data.a->A;
data.b->B;
pthread_create(&multiplicationWorker, NULL, (void *) &alterAarrays, data);
...and a private function...
void alterArrays ( v* coords)
{
...
}
Question:
I want to pass references to the 2D arrays inside alterArrays. Also it won't let me assign the values of the 2D arrays like this. Any suggestions?
data.a->A;That isn't valid and wouldn't do anything useful even if it were