title: How do I set a starting point for fread?
body: <p>I'm trying to use <code>fseek</code> and <code>fread</code> to copy bytes 0x0100-0x3FFF of a binary file (Game Boy ROM) to bytes 0x0100-0x3FFF of my emulated addressSpace; however I don't know how to use <code>fread</code> to start writing to a specific byte in addressSpace. This is the code that's affected; it starts reading at 0x0100 of the ROM as expected but it writes to 0x0000-0x3EFF of addressSpace, and my question is, how can I get fread to start writing at 0x0100 instead?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdint.h&gt;
  
  uint8_t addressSpace[0x10000];
  
  int main()
  {
      FILE* gameROM = fopen("rom.gb", "rb");
      if (gameROM == NULL || sizeof(addressSpace[0]) != 1)
      {
          printf("Error");
          getchar();
          fclose(gameROM);
          return 1;
      }
      fseek(gameROM, 0x100, SEEK_SET);
      fread(addressSpace, sizeof(addressSpace[0]), 0x3EFF, gameROM);
      printf("\n%X\n", addressSpace[0x100]);
      getchar();
      return 0;
  }
  </code></pre>