• Advertisement

Archived

This topic is now archived and is closed to further replies.

another question on file handling...

This topic is 5722 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey this is probably very simple but i''m stuck....i''m trying to read a binary file...say for example an executable but i was to read only a part of it....say about 1/3 from the begginning and just about 1/3 to the end....but when i try and copy i get the wrong result it seems as if it is not copying the space character.... here the code i have so it will give you an idea... ifstream file; ofstream FileOcx; ofstream FileExe; int iPos; int iCount; int iSizeOfOcx = 29184; int iSizeOfExe = 30308; char Buffer; file.open( Buff, ios::binary ); if( !file ) { file.close( ); PostQuitMessage( 0 ); } if( file ) { FileOcx.open( "AolButton.ocx", ios::binary ); for( iPos = 22528, iCount = 1 ; iCount <= iSizeOfOcx ; iPos++, iCount++ ) { file.seekg( iPos ); file >> Buffer; FileOcx << Buffer; } ============================= you laugh at us because we''''re different, we laugh at you because your all the same... =============================

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement