another question on file handling...

Started by
-1 comments, last by ecaf 21 years, 9 months ago
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... =============================
=============================you laugh at us because we''redifferent, we laugh at youbecause your all the same...=============================

This topic is closed to new replies.

Advertisement