Im trying to read a file not just from the last line but from the end of the line to the beginning too. Example:
Im trying
to read a file
How do I want to read:
elif a daer to
gniyrt mI
How do I do that?
Im trying to read a file not just from the last line but from the end of the line to the beginning too. Example:
Im trying
to read a file
How do I want to read:
elif a daer to
gniyrt mI
How do I do that?
You read each line, put all in a buffer ..reverse it and then parse. The thing is most of the time it is not needed to read the file in reversed manner..But you can try this.
Some nice organized manner of doing this will be..using a LIFO data structure. You can use a simple array and make it behave like a stack. Push everything then pop from top.