title: Read an input file to an array
body: <p>How can I read a text file's content and put it into an array? For example, I have 3, 2, 1, 0 in my text file and I want to read the file and store the values in an array. I am using the <code>fscanf</code> function to do this:</p>
  
  <pre><code>int a[4];
  point = fopen("test.txt", "r");
  
  for(int i = 0; i &lt; 4; i++)
  {
      fscanf( point , "%d " , &amp;a[i]);              
  }
  
  // printing put the values ,but i dont get the text file values
  
  for(int i = 0; i &lt; 4; i++)
  {
      printf("%d\n" , a[i]);  
  }
  </code></pre>
  
  <p>I ran this program but I didn't get the values present in the text file. Can anybody please suggest a way to do this? I want to specifically solve it with the <code>fscan</code> function.</p>