title: fscanf type function for streams?
body: <p>I'm used to using fscanf for simple file input, because it makes it simple.  I'm trying to move to streams though and I'd like to be able to do this:</p>
  
  <pre><code>fscanf(file, %d %s, int1, str1);
  </code></pre>
  
  <p>as you can see it's relatively easy to read through a file, stick the first int you come across into one container, and then the first string into a char*.  What I want, is to do this with fstreams, using stream functions.  This is what I came up with, with my limited stream knowledge.</p>
  
  <pre><code>while((fGet = File.get() != EOF))
  {
      int x;
      int y;
      bool oscillate = false;
      switch(oscillate)
      {
      case false:
          {
              x = fGet;
              oscillate = true;
              break;
          }
      case true:
          {
              y = fGet;
              oscillate = false;
              break;
          }
      }
  }
  </code></pre>
  
  <p>Basically I want to scan through a file and put the first int into x, and the second into y.</p>
  
  <p>This is pretty bad for a few reasons, as you can tell, and I'd never actually use this but it's all I can think of.  Is there a better way to go about this?</p>