Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - Damn I hate askin C++ n00b questions
  
User name:
Password:
Reply:
 

UserPost
HyperLamer
Posts: 7403/8210
Or use good ol' fopen and fseek.
beneficii
Posts: 531/567
Originally posted by firemaker
In C++ if you have opened a file in ios::binary how do you jump to the end of the file so that you can manipulate it from the end? Also When trying to decompress this file how do you get your functions to apply to te file?


It may be easier to just load the whole file into memory and work with it directly then save it. That's what I do. The seekg statements, etc., tend to be somewhat stringent, like once you've gone to a point in the file, you can't go back, etc. Do you understand what I'm saying?

You just malloc a variable and then load the file's contents into it. When you're done processing it just save it back.
Eponick
Posts: 33/37
To jump to the end of the file try:

file.seekg(0, ios::end);

firemaker
Posts: 243/247
In C++ if you have opened a file in ios::binary how do you jump to the end of the file so that you can manipulate it from the end? Also When trying to decompress this file how do you get your functions to apply to te file?
Acmlm's Board - I2 Archive - Programming - Damn I hate askin C++ n00b questions


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.003 seconds.