title: Unable to read from external text file
body: <p>I've got a dynamically allocated array of a struct type (let's call it structtype), and I was trying to read to it from an external text file. structtype looks something like this:</p>
  <pre><code>{
      char itemName[15];
      char status;
      int itemAmt;
      char tried;
      char desc[130];
      int rating;
  }
  </code></pre>
  <p>And the text file looks something like this:</p>
  <pre><code>SomeName: y | 3 | Hello Hello | y | 9
  </code></pre>
  <p>in that exact format. I am trying to read from said text file using this code:</p>
  <pre><code>void games::LoadFrom(){ // Loads games from the file into array (AllItems)
          ifstream file_in;
          structtype temparray[15] = {};
          for (int i = 0; i &lt; 15; ++i) // Empties out AllItems
                  AllItems[i] = {};
          file_in.open(&quot;items.txt&quot;);
          int i = 0; // Counter
          if (file_in){
                  while (!file_in.eof() &amp;&amp; i &lt; 15){ // Checks if its the end of the file, or if its the max amount I can store
                          file_in.get(temparray[i].itemName, 15, ':');
                          file_in.ignore(100, '|');
  
                          file_in &gt;&gt; temparray[i].status;
                          file_in.ignore(100, '|');
                          AllItems[i].status = temparray[i].status;
  
                          file_in &gt;&gt; temparray[i].itemAmt;
                          file_in.ignore(100, '|');
                          AllItems[i].playerAmt = temparray[i].itemAmt;
  
                          file_in.get(temparray[i].desc, 131, '|');            // All of this reads in a game from the file, and stores it in the AllItems array
                          file_in.ignore(100, '|');
  
                          file_in &gt;&gt; temparray[i].tried;
                          file_in.ignore(100, '|');
                          AllItems[i].tried = temparray[i].tried;
  
                          file_in &gt;&gt; temparray[i].rating;
                          file_in.ignore(100, '\n');
                          AllItems[i].rating = temparray[i].rating;
  
                          ++i;
  
                          file_in.get(temparray[i].itemName, 15, ':');
                          file_in.ignore(100, ':');
                  }
                  cout &lt;&lt; AllItems[0].itemAmt;
  
          }
          cout &lt;&lt; AllItems[0].itemAmt;
          file_in.close();
  
      }
  </code></pre>
  <p>My problem is that it doesn't read anything in, and instead leaves everything in the struct object at its zero equivalent.</p>
  <h2>Important</h2>
  <p>To keep in mind: AllItems is a dynamically allocated array, and I was unable to read stuff to it directly, instead I made a separate statically allocated array called temparray, which is strictly for transferring info to AllItems.</p>
  <p>When the loop runs, it runs once, and then exits, even though the text file has about 10 items. How can I actually read items in?</p>