title: pthread_join receiving results from function in a array
body: <p>I'm working with pthreads in C and have run into problems(again).
  I am trying to send results as an array of a function to my main thread.</p>
  
  <p>This code finds the largest value for each worker(1worker/row) and saves the indexes for that value. So far so good.
  I will explain my problem below this function. This code does what i want.</p>
  
  <pre><code>for (i = first; i &lt;= last; i++){
      for (j = 0; j &lt; size; j++){
      total += matrix[i][j];
          if(matrix[i][j] &gt; biggest){
      biggest = matrix[i][j]; 
      x=i;
      y=j;
      maxValueResult[1]=i;
      maxValueResult[2]=j;
      }else if(matrix[i][j] &lt; smallest){  
      smallest = matrix[i][j];
              indexes[2]=i;
              indexes[3]=j;   
  }
  } 
  }      
      maxValueResult[0]=biggest;
      maxValueResult[1]=x;
      maxValueResult[2]=y;
  printf("Results: maxValue: %d cord[%d,%d]\n",maxValueResult[0],maxValueResult[1],maxValueResult[2]);
  
  return *maxValueResult;
  </code></pre>
  
  <p>My problem is when i recive the results in pthread_join only maxValueResult[0] works, from maxValueResult[1] and maxValueResult[2] i only get addresses or something.
  before: " return *maxValueResult;" all three values are correct, looking something like this: "Results: maxValue: 95 cord[3,3]"</p>
  
  <p>Here is where i call pthread_join:</p>
  
  <pre><code>for(l=0;l&lt;numWorkers;l++){
  pthread_join(workerid[l], &amp;maxValue);
  temp[l] = maxValue[0];
  if(maxValue[0]&lt;temp[1]){
      maxValue[0] = temp[1];
      xCORD = maxValue[1];
      yCORD = maxValue[2];
  }
  }
  printf("Results: maxValue: %d cord[%d,%d]\n",maxValue[0],xCORD,yCORD);
  </code></pre>
  
  <p>That prints this:
  "Results: maxValue: 95 cord[0,1629976061]", where 95 is correct but not the other two.
  What can I do to fix this?
  As you probably can see from my code, im not very experienced. </p>
  
  <p>EDIT: I forgot to tell about the warnings, i get a couple! Unfortunatly they are in swedish, but i post them here anyway:
  "$ gcc -o sumb matrixSumB.c
  matrixSumB.c: In funkcion "main":
  matrixSumB.c:120:1: warning: passing argument 2 of ‘pthread_join’ from incompatible pointer type
  /usr/include/pthread.h:144:5: note: expected ‘void **’ but argument is of type ‘int * (*)[3]’
  matrixSumB.c: In function "Worker":
  matrixSumB.c:172:1: warning: return makes pointer from integer without a cast. 
  "</p>
  
  <p>Kind Regards Leo</p>