title: std::ifstream.read() doesn't return anything to my buffer
body: <p>When I am reading file with function <code>read()</code>, this function doesn't save data to my buffer <code>smoke</code>. I'm trying to read a file and save it to <code>smoke</code> with binary content.</p>
  
  <p>How can I do it better, with vectors?</p>
  
  <pre><code>std::ifstream file("favicon.ico", std::ios::binary);
  char ak47xd[1024];
  std::string testxcs = "";
  if (file.is_open()) {
      file.seekg(0, file.end);
      const size_t length = file.tellg();
      file.seekg(0, file.beg);
      char smoke[318];
      file.read(smoke, length);
      printf("sss: %s\n",smoke);
      for (int i = 0; i &lt; length; i++) {
          printf("sk: %c\n",smoke[i]);
          testxcs += smoke[i];
          //printf("%i : %X\n", i, smoke[i] &amp; 0xFF);
          //testxcs += (smoke[i] &amp; 0xFF);
          //printf("Smoke: %s\n",testxcs.c_str());
      }
  }
  </code></pre>
  
  <p>Output: 
  <a href="https://i.stack.imgur.com/PLoCg.png" rel="nofollow noreferrer">Here picture</a></p>
  
  <p><a href="https://i.stack.imgur.com/24mWh.png" rel="nofollow noreferrer">Here problem</a></p>