title: How C program load data from txt file?
body: <p>I have found this code here on forum, it works fine but I have no clue how it works, why it work. Can someone tell me a few words about this code please? I would like to understant it and know how to use it. Or if you know some better way, how to input data into bin. file from txt file, can you give me some advice please?  </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #define BLOCK_SIZE 256
  
  int main(void) 
  {
      char buf[BLOCK_SIZE];
      size_t bytes;
  
  while(!feof(stdin)) {
      bytes = fread(buf, 1, BLOCK_SIZE, stdin);
      fwrite(buf, 1, bytes, stdout);
  }
  return 0;
  }
  </code></pre>
  
  <p>Thank you very much.</p>