title: How to read a file in multiple chunks until EOF (C++)
body: <p>So, here's my problem: I want to make a program that reads chunks of data from a file. Let's say, 1024 bytes per chunk.
  So I read the first 1024 bytes, perform various operations and then open the next 1024 bytes, without reading the old data. The program should keep reading data untile the EOF is reached.</p>
  
  <p>I'm currently using this code:</p>
  
  <pre><code>std::fstream fin("C:\\file.txt");
  
  vector&lt;char&gt; buffer (1024,0); //reads only the first 1024 bytes
  fin.read(&amp;buffer[0], buffer.size());
  </code></pre>
  
  <p>But how can I read the next 1024 bytes? I was thinking by using a for loop, but I don't really know how. I'm totally a noob in C++, so if anyone can help me out, that would be great. Thanks!</p>