title: How to assign function output to an array type? In C?
body: <p>I try to assign to assign the output of a function to an array, but upon compiling, it doesn't seem to work.  </p>
  
  <p>The function <code>takeInputs</code> should return an array.  And, as I have it, I thought that <code>holdInputs</code> is an array.  However, it doesn't seem to compile.  What is the error here?</p>
  
  <pre><code>// Holds the expression that the user enters
  struct Inputs  
  {
      char word[10]; 
  };
  
  // Declare these: 
  struct Inputs* takeInputs(struct Inputs *userInputs, int numInputs);  // must return a pointer to a pointer because returning array 
  struct Inputs* printInputs(struct Inputs *userInputs);
  
  struct Inputs* takeInputs(struct Inputs *userInputs,int numInputs){
      /*Inputs:
          userInputs: an array of struct Inputs, each of which contain a string called "word" 
          numInputs:  integer from user 
      */
  
      int i;
      for (i=0;i&lt;numInputs;i++){
          printf("please input the word");        
          fgets(userInputs[i].word,10,stdin);
      }
  
  
  }
  
  int main(int argc, char const *argv[]){
  
      //user Input should look like this:  ./takes_Input.exe 7
      if (argc!=2){
          error("user Input should look like this:  ./takes_Input.exe 7");
      }
  
      // represents the number of words the user is entering 
      int numInputs = atoi(argv[2]);
  
      struct Inputs allInputs[numInputs];
      struct Inputs holdInputs[numInputs];
  
      holdInputs = takeInputs(allInputs,numInputs);
      // printInputs(holdInputs);
      return 0;
  }
  </code></pre>
  
  <p>Error output:</p>
  
  <pre><code>takes_Input.c: In function ‘main’:
  takes_Input.c:53:13: error: assignment to expression with array type
    holdInputs = takeInputs(allInputs,numInputs);
  </code></pre>
  
  <p>But I thought I initialized holdInputs as an array??  Thanks.</p>