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 | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
firemaker

Level: 26

Posts: 243/247
EXP: 94178
For next: 8097

Since: 03-23-04
From: UK berkshire

Since last post: 17 days
Last activity: 11 days
Posted on 10-02-05 08:11 PM Link | Quote
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?
Eponick

Blue Octorok
Level: 8

Posts: 33/37
EXP: 1760
For next: 427

Since: 09-02-05
From: Your closet

Since last post: 6 hours
Last activity: 6 hours
Posted on 10-02-05 09:43 PM Link | Quote
To jump to the end of the file try:

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

beneficii

Lakitu
Level: 36

Posts: 531/567
EXP: 299656
For next: 8454

Since: 06-27-04
From: Cordova, TN, USA

Since last post: 14 hours
Last activity: 6 hours
Posted on 10-03-05 08:43 AM Link | Quote
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.


(edited by beneficii on 10-02-05 11:44 PM)
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 7403/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 10-03-05 09:57 AM Link | Quote
Or use good ol' fopen and fseek.
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
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.012 seconds.