title: Overloading istream operator>> c++
body: <p>Say I have a vector of chars and I pushed it into a stream as a string, rather than a vector of chars, how would i get back the vector of chars using operator>>?</p>
  
  <pre><code>class C{
      private:
          vector&lt;char&gt; c;
  
      public:
          C(string str){
            for(int x = 0; x &lt; str.size(); x++)
                c.push_back(str[x]);
          }
  
          vector&lt;char&gt; data(){
             return c;
          }       
  };
  
  ostream operator&lt;&lt;(ostream &amp; stream, C &amp; in){
     for(int x = 0; x &lt; in.data().size(); x++)
        stream &lt;&lt; in.data()[x];
     return stream;
  }
  
  istream operator&gt;&gt;(istream &amp; stream, C &amp; in){
      // ???
      // what kind of loop?
  }
  </code></pre>