[Solved] swapping bytes in a file in c++ [closed]


  1. Create two buffers of length 100 bytes each, say A and B.
  2. Read 100 bytes from file to A (assuming that the file cursor points to the beginning of the file).
  3. Seek to file length n-100.
  4. Read 100 bytes from file to B.
  5. Again, seek to file length n-100.
  6. Write 100 bytes from A to file.
  7. Seek to file position 0.
  8. Write 100 bytes from B to file.

solved swapping bytes in a file in c++ [closed]