title: how to cascade 2d int array to 2d void pointer array? and how to print the thread id of 2d array argument?
body: <p>I have this code as a practice but I couldn't find a clear way to solve it and we have to stick to this format</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  #include &lt;pthread.h&gt;
  
  #define x 2
  
  pthread_t arr[x];
  
  int arr2[2][2] = {{1,1},{2,2}};
  
  void* func(void* arg[][]){
  
  //print thread id
  
  //each thread will print one row of the 2d array (arr2)
  
  }
  
  int main(){
  
      pthread_attr_t attr;
  
      pthread_attr_init(&amp;attr);
  
              // create the threads
  
      int i,k;
  
      for(i=0; i&lt;2 ;i++){
  
              k=pthread_create(&amp;arr [i] , &amp;attr, func, //fill here );
  
      }
  
              // join the threads
  
  
  
              return 0;
  
  
  
  }
  </code></pre>
  
  <p>first I had this error</p>
  
  <p>main.c:12:18: error: array type has incomplete element type ‘void *[]’</p>
  
  <pre><code>void* func(void* arg[][]){
  </code></pre>
  
  <p>then I solved it using</p>
  
  <pre><code>void* func(void* arg[2][2]){
  </code></pre>
  
  <p>then a cascading problem raised,</p>
  
  <pre><code> k=pthread_create(&amp;arr [i] , &amp;attr, func, (void*)arr2 );
  </code></pre>
  
  <p>main.c:25:37: warning: passing argument 3 of ‘pthread_create’ from incompatible pointer type [-Wincompatible-poin</p>
  
  <p>ter-types]                                                                                                      </p>
  
  <p>/usr/include/pthread.h:244:12: note: expected ‘void * (*)(void *)’ but argument is of type ‘void * (*)(void * (*)</p>
  
  <p>[2])’</p>
  
  <p>how to cascade 2d int array to 2d void pointer array?</p>
  
  <p>and how to print the thread id of 2d array argument?</p>