title: how to get int with fstream get() in c++
body: <p>I am a newer to C++,
  Now what I am going to do is creating a file, and write int values into it
  Then I want to get those int values with get function!(Here the excepted type of return is int )
  Actually this is an index file, so what I am going to put into it are all int values! 
  But I found that both fstream.put and fstream.get could only operate char values.
  So is there anyone would like to help me, how to do my job.
  And here is my code</p>
  
  <pre><code>vector&lt;int&gt; tra1;
  vector&lt;int&gt; tra2;
  int last_capa = 0;
      for(int i=1;i&lt;97;i++){
          output.put(tra1[i-1] * 5 + tra2[i-1] + last_capa);
          last_capa += (tra1[i-1] - 1) * 5 + tra2[i - 1];
      } 
  </code></pre>
  
  <p>Below is the code to read int
  Here I try to get an int number to operate</p>
  
  <pre><code>vector&lt;int&gt; tra4
  output.seekg(100);
  unsigned int n = output.get() + tra4[2];
  </code></pre>
  
  <p>Thanks for your help</p>
  
  <p>Haoran</p>