title: Loading big file in c
body: <p>This is my program code that can load inputs 1GB, 2GB, but I would need to load files larger than 2GB. I work at Windows.</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main() {
      FILE *stream;
      size_t size;
      int fileSize = 0;
      char *input;
  
      // Open file, find the size of it
      stream = fopen(&quot;3GB.bin&quot;, &quot;rb&quot;);
      fseek(stream, 0L, SEEK_END);
      fileSize = ftell(stream);
      fseek(stream, 0L, SEEK_SET);
  
      input = (char *)malloc(fileSize + 1);
  
      // Stream file into memory
      size = fread(input, 1, fileSize, stream);
      input[size] = 0;
      fclose(stream);
  
      printf(&quot;size file is: %d\n&quot;, fileSize);
  
      free(input);
  
      return 0;
  }
  </code></pre>
  <p>The problem is that it does not load files larger than 2GB at all...
  Don't know where the problem is?</p>