- Create two buffers of length 100 bytes each, say A and B.
- Read 100 bytes from file to A (assuming that the file cursor points to the beginning of the file).
- Seek to file length n-100.
- Read 100 bytes from file to B.
- Again, seek to file length n-100.
- Write 100 bytes from A to file.
- Seek to file position 0.
- Write 100 bytes from B to file.
solved swapping bytes in a file in c++ [closed]