title: Output vector of vector to text file with tab delimiter C++
body: <p>i'm trying to output a 2D vector into a txt file, the problem is that i'm getting extra tabs at row end and new line at the of the text 
  here it is my code </p>
  
  <pre><code> int main()
  {
  
      vector&lt; vector&lt;double&gt; &gt; mv;
      vector&lt; vector&lt;double&gt; &gt;::iterator row;
      vector&lt;double&gt;::iterator col;
      ofstream output_file("Mat.txt");
      setVector(mv,5,5);
      for(row = mv.begin(); row != mv.end();row++)
      {
          for(col = row-&gt;begin();col != row-&gt;end();col++)
          {
              output_file &lt;&lt; *col &lt;&lt; '\t';
          }
         output_file &lt;&lt; '\n';
      }
  
  
      return 0;
  }
  </code></pre>
  
  <p>Output Sample:
  <a href="https://i.stack.imgur.com/7voND.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7voND.png" alt="enter image description here"></a></p>