title: Having Run time check failure #2-stack around the variable "numbers"
body: <p>i have the input file as shown below</p>
  
  <p>5</p>
  
  <p>8</p>
  
  <p>10</p>
  
  <p>the actually face i need to read the file more lines the the above example.(without the space in between. Thus, i need to have the size of array depend on the lines of text file. this is the method i use by occur r</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;ctype.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;stdio.h&gt;
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      FILE *test;
      int numbers[]={0};
      int i=0;
      char *array1;
      if((test=fopen("Input1.txt","r"))==NULL)
      {
          printf("File could not be opened\n");
      }
      else
      {
          array1 = (char*)malloc(1000*sizeof (char));
          if((test=fopen("Input1.txt","r"))==NULL)
          {
              printf("File could not be opened\n");
          }
          else
          {
              while(fgets(array1,(sizeof array1)-1,test)!=NULL) 
              {
                  numbers[i]=atoi(array1);
                  i++;
              }
              for(i=0;i&lt;sizeof(array1)-1;i++)
              {
                  printf("%d\n",numbers[i]);
              }
          }
      fclose (test);
      }
      system("pause");
      return 0;
      free(array1);
  }
  </code></pre>