title: Declaring a Char Array of [x] characters long
body: <p>I've been trying to declare an array using calloc, normally this is pretty easy but i'm stumped with this one: </p>
  
  <p>I need to declare a char array which has to be [n amount long] and hold names which are declared as char[x]. Where x is a value that changes based on input. The idea is to save the names to the array and then compare them to a list with the same names.</p>
  
  <p>Declaring the array as</p>
  
  <pre><code>char *array = calloc(number_x,sizeof(char));
  </code></pre>
  
  <p>works but when we compile it i get a </p>
  
  <pre><code>warning: incompatible pointer to integer conversion assigning to 'char' from 'char [10]'
  </code></pre>
  
  <p>also tried declaring the array with:</p>
  
  <pre><code>char* array = malloc(number_x*sizeof(char[21]));
  </code></pre>
  
  <p>But that returns the same type of error. Any way to solve this?</p>
  
  <p><strong>EDIT:</strong> 
  To answer the comments from below:
  The error points here:</p>
  
  <pre><code>For (int i = 0; i &lt; number_x; i++) {
  current_word = find_name((wordbank-&gt;list),(array [i]));
  .... blah ... 
  }
  </code></pre>
  
  <p>(find_name) is a function where it takes a pointer to the list and the pointer to the char name then returns a node to the name.</p>
  
  <p>Sorry about that.</p>
  
  <p><strong>EDIT AGAIN:</strong>
  number_x is the number of words that is stored within the list. So we can have 1000 words in total, but each word has to be stored is of type char[21] and as such can only be 21 characters maximum.</p>