At the C runtime library level, check out fread , fwrite, and fseek .
At the Win32 API level, view ReadFile , WriteFile, and SetFilePointer . MSDN has extensive I / O API file coverage .
Note that both ReadFile and WriteFile accept the OVERLAPPED struct argument, which allows you to specify the file offset. The offset is respected for all files that support byte offsets, even if they are open for synchronous input (I / O).
Depending on the problem you are trying to solve, file mapping may be the best design choice.
source
share