Reading and Writing Files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • James Hagonoy
    New Member
    • Feb 2012
    • 1

    Reading and Writing Files

    Hi,I have a Question about reading and writing a file

    im little bit curious about this.

    for example I write and save it to a notepad "Helo world"
    then I want it to do in reverse order then in turn in to dlrow oleH

    and it will produce another notepad.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Files always read in a forward direction. To reverse a file you would read the entire file into a buffer and process the buffer from the end to the beginning.

    If the file is oo large for meory, you can read records from the beginning to the end placing each record in a linked list. You then reverse the file by processing the list backwards and the data in each node backwards.

    Bon appetit!

    Comment

    Working...