Initializer is overwriting second array
<p>I cannot solve this, I'm almost accepting the fact that it might be a memory issue with my machine at this point.</p>

<p>I have this initializer:</p>

<pre><code>Search::Search(ifstream&amp; inFile)
{

    int id = 0;
    int i = 0;

    inFile &gt;&gt; id;

    while (inFile) {

        if(i &lt; SEARCH_DATA_SIZE) {

            SearchDataFirst[i] = id;
            SearchDataFirstSorted[i] = id;

        } else if(i &gt;= SEARCH_DATA_SIZE) {

            SearchDataLast[i] = id;
            SearchDataLastSorted[i] = id;

        }

        i++;
        inFile &gt;&gt; id;
    }

}
</code></pre>

<p>And in my header i have private data like so:</p>

<blockquote>
  <p>const int SEARCH_DATA_SIZE = 20;</p>

<pre><code>int SearchDataFirst[SEARCH_DATA_SIZE];
int SearchDataLast[SEARCH_DATA_SIZE];
int SearchDataFirstSorted[SEARCH_DATA_SIZE];
int SearchDataLastSorted[SEARCH_DATA_SIZE];
</code></pre>
</blockquote>

<p>The initializer is getting the first 20 ints from inFile, storing them, and then going to the next records and storing those in separate arrays,</p>

<p>When I do a print of the arrays, SearchDataFirstSorted has the values of SearchDataLast, even though there is no possible way ever that this could happen. SearchDataLastSorted has weird funky numbers.</p>

<p>SearchedDataFirst is fine.</p>

<p>I have never been this frustrated with a programming language.</p>

<p>Hopefully you can help.</p>

<p>There is nothing else going on, only the initializer is being called at this point.</p>
