title: Optimal way to get a string or char* into an istream?
body: <p>What is the most optimal way to get a string or char* pointer into an istream.</p>
  
  <p>I want to do the following</p>
  
  <pre><code>std::string a = "abc..";
  
  //I know this can be done, not sure if this is most efficient
  // and not sure about char*    pointers
  std::istringstream istr (a);
  ...
  foo (istr); 
  
  
  void foo(std::istream&amp; is) {
  
  }
  </code></pre>