User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C section within the Software Development category of DaniWeb, a massive community of 426,411 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,340 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C advertiser: Programming Forums

how to read a text file backwards?

Join Date: May 2007
Posts: 5
Reputation: stanats is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
stanats stanats is offline Offline
Newbie Poster

Re: how to read a text file backwards?

  #3  
May 15th, 2007
Originally Posted by Narue View Post
Read it forward, store it in a reversible container, and then walk through the container backward. Or if you know the exact length of each line, you could open the file as binary and use fseek with read to get the lines in reverse. Or you could physically reverse the file before reading it. Or you could use recursion, but that's an exceptionally poor solution.




what container would you suggest? is it possible to use some kind of strtok but backwards?
Reply With Quote  
All times are GMT -4. The time now is 1:41 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC