Updated Program still crashing, can't seem to find a solution?
<p>Here is my original post: <a href="http://stackoverflow.com/questions/13944001/program-crashes-after-opening-file">Program crashes after opening file</a> </p>

<p>I've tried again and again to fix my code, but it still either crashes or runs uncontrollably.  I have yet to find a solution.</p>

<p>Here is my updated code:</p>

<pre><code>while(!intInputFile.eof())
{
   intNode* anotherInt;
   anotherInt = new intNode;
   if(intList==NULL)
   {
       intList = anotherInt;
       lastInt = anotherInt;
   }
   else
   {
      lastInt-&gt;nextNode = new intNode;
      lastInt = lastInt-&gt;nextNode;
      lastInt-&gt;nextNode = NULL;
   }
   lastInt-&gt;intValue = fileInt;
   lastInt = lastInt-&gt;nextNode;
   lastInt-&gt;nextNode = NULL;
   intInputFile &gt;&gt; fileInt; // *** Problem occurs on this line. ***
}
</code></pre>
