title: A dynamic 1D array in C don't want to ingest each character of a file in each of his boxes
body: <p>In C, I want to fill a dynamic array with each character of a file in each of his boxes.
  But instead, when I print my array I have:</p>
  
  <pre><code>0 = [] 
  1 = [] 
  2 = [] 
  3 = [] 
  4 = [] 
  5 = [] 
  6 = [] 
  7 = [] 
  8 = [] 
  9 = []
  </code></pre>
  
  <p>I have no compilation errors, but valgrind said that I have a:</p>
  
  <pre><code>Conditional jump or move depends on uninitialised value(s) 
  </code></pre>
  
  <p>in my main at the printf.
  That's strange, because even with an initialisation in my main:</p>
  
  <pre><code>array_valid_char = NULL;
  </code></pre>
  
  <p>valgrind keeps getting me that error.
  And even if I change to:</p>
  
  <pre><code>printf("%d = [%d] \n", i, array_valid_char[i]);
  </code></pre>
  
  <p>the display is the same.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int* f(char* name_file_in)
  {
      FILE *file_in;
      int* array_valid_char = malloc(10 * sizeof(int*));
      int read_char;
      file_in = fopen(name_file_in,"rb");
      if(file_in)
      {
          while ((read_char = fgetc(file_in)) != EOF)
          {
              *(array_valid_char++) = read_char;
          }
      }
      if(file_in){fclose(file_in);}
      return array_valid_char;
  }
  
  int main(int argc,char* argv[])
  {
      int *array_valid_char = malloc(10 * sizeof(int*));
      array_valid_char = f(argv[1]);
      for (int i = 0; i &lt; 10; i++)
      {
          printf("%d = [%c] \n", i, array_valid_char[i]);
      }
      return(0);
  }
  </code></pre>
  
  <p>What is wrong with my code?</p>