title: Trying to initialize and fill a 2D char array with using structure
body: <p>What I am trying to do is use a structure to create and display a 2D array of characters in the function '<em>function1( )</em>'.  This array will be sent back to the <em>main( )</em> so I can use it further in my program.  However my program is plagued with problems.  I am having trouble with pointers. I assume my problem is somewhere with either my pointers or my variables.  I've tried several combinations with no effort.  As a beginner, it probably is some odd combination that is not coming to my mind.  </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  
  #define ROW 13
  #define COL 16
  
  typedef struct letter_array {
      char** letters;
      struct letter_array *ltr_ptr;
  } larray;
  
  void function1 (larray ** letter1[*][16]);
  int function2 (larray letter2[][16]);
  int function3 (larray letter3[][16]);
  void function4 (int hor_ans, int ver_ans);
  
  int main (void)
  {
      larray letter_list;
      int vert, hori, **lptr;
  
      lptr = malloc(ROW*sizeof(int*));
  
      for(vert = 0; vert&lt;ROW; vert++)
      {
          lptr [vert] = malloc(COL*sizeof(int));
      }
  
  
      printf("\n \t\t\t *** Hello! ***");
  
  
      printf("\n This program will create a random selection of 180 upper-case"
             " characters. \n\n");
  
      function1(&amp;letter_list); //Problem #1
  
  
      printf("\n\nThank you for using my random character array program. \n"
             "\t\t Have a good day! \n");
  
      return ( 0 ) ;
  }    
  
  
  void function1 (larray **letter1 [][16])
  {
      int i, z, funptr;
  
      srandom((unsigned)time(NULL));
  
      for(i=0; i&lt;12; i++)
      {
          letter1 [i] &lt;- (int*) funptr;     // Problem #2-3
          for(z=0; z&lt;15; z++)            
          {
              letter1[i][z] = random( )%26+'A';  // Problem #4
              printf("%c ", letter1[i][z]);
          }
          printf("\n");
      }
  
      return ;
  }
  </code></pre>
  
  <p>The errors are below and commented.</p>
  
  <ol>
  <li>warning:passing argument 1 of 'function1' from incompatible pointer type</li>
  <li>warning: cast to pointer from integer of different size</li>
  <li>error: wrong type argument to unary minus</li>
  <li>warning: assignment makes pointer from integer without a cast</li>
  </ol>