title: Parsing in a textfile in C++
body: <p>At the moment I'm making a simply 3D race game and I would like the the ground textures to be modable via a text file. I know there are other, "better" ways of doing this, but I want to use the <code>ifstream</code> so I gain a better understanding of how it works.</p>
  
  <p>In my code I have already set up a grid on the ground for where the track is going placed, and I have one texture that covers the entirity of it.</p>
  
  <p>Here is a code block of how I'm trying to use the ifstream to load in different textures</p>
  
  <pre><code>string line;
  ifstream myfile ("track1.txt");
  if (myfile.is_open())
  {
      while ( myfile.good() )
      {
          getline (myfile,line);
          if( line == 0)
          {
               const wstring textureFileName=TEXT("crate.jpg");
          }
      }
      myfile.close();
  }
  </code></pre>
  
  <p>My text file is simply one line of of ten 0 in a row. Each 0 is separated by a comma like so</p>
  
  <p>0,0,0,0,0,0,0</p>
  
  <p>Have I set up the ifstream correctly to do what I require it to do?</p>