title: What's the difference between read, readsome, get, and getline?
body: <p>What is the difference between these functions. When I use them they all do the same thing. For example all three calls return <code>"hello"</code>:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;sstream&gt;
  
  int main()
  {
      stringstream ss("hello");
      char x[10] = {0};
      ss.read(x, sizeof(x));          // #1
      std::cout &lt;&lt; x &lt;&lt; std::endl;
      ss.clear();
      ss.seekg(0, ss.beg);
      ss.readsome(x, sizeof(x));      // #2
      std::cout &lt;&lt; x &lt;&lt; std::endl;
      ss.clear();
      ss.seekg(0, ss.beg);
      ss.get(x, sizeof(x));           // #3
      std::cout &lt;&lt; x;
      ss.clear();
      ss.seekg(0, ss.beg);
      ss.getline(x, sizeof(x));       // #4
      std::cout &lt;&lt; x &lt;&lt; std:endl;
  }
  </code></pre>