title: Run-Time Check Failure #2 - Stack around the variable 'seqA' was corrupted
body: <p>i have windows 8 with vs2010, when i run this part of program this error shown:
  Run-Time Check Failure #2 - Stack around the variable 'seqA' was corrupted.
  ..............................................................................</p>
  
  <pre><code>#include &lt;iostream.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;string&gt;
  #include&lt;stdlib.h&gt;
  #include &lt;fstream&gt;
  using namespace std;
  
      int main(){
  int lenA = 0;
  int lenB = 0;
  FILE * fileA, * fileB;
  char holder;
  char seqA[10], seqB[10];
  
  /*open first file*/
  fileA=fopen("c:\\str1.fa", "r");
  
  /*check to see if it opened okay*/
  if(fileA == NULL) {
      perror ("Error opening 'str1.fa'\n");
      exit(EXIT_FAILURE);
  }
  
  
  /*open second file*/
  fileB = fopen("c:\\str2.fa", "r");
  
  /*check to see if it opened okay*/
  if(fileB == NULL) {
      perror ("Error opening 'str1.fa'\n");
      exit(EXIT_FAILURE);
  }
  
  /*measure file1 length*/
  while(fgetc(fileA) != EOF) {
      holder = fgetc(fileA);
      seqA[lenA]=holder;
      lenA++;
  }
  lenA--;
  
  fclose(fileA);
  
  holder='0';
  
  /*measure file2 length*/
  while(fgetc(fileB) != EOF) {
      holder = fgetc(fileB);
      seqB[lenB]=holder;
      lenB++;
  }
  lenB--;
  
  fclose(fileB);  
  </code></pre>
  
  <p>link <a href="http://i1353.photobucket.com/albums/q671/mahdimb/ad_zps4ef6d8d6.jpg" rel="nofollow">picture</a> of this error.</p>