Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File i/o simple question

Status
Not open for further replies.

MET777

Programmer
Jun 1, 2005
5
US
if i want to "Delete", or not write the first 4 characters of a memory block... how do i do so?

heres some sample code

in.open ("C:\\moviecopy.wmv", ios::binary );
in.seekg (0, ios::end);

length = in.tellg();

in.seekg (0, ios::beg);

buffer = new char [length];

in.read (buffer,length);
in.close();

out.open("C:\\moviecopyfix.wmv");
out.write(buffer,length);
out.close();

i want to take out the first four characters in this binary memory block... please help
 
thats not working for me... its adding 15 bytes (bits?) of info every time i open and re write no matter what.
 
Maybe you need to add ios::binary to your 2nd open call:
Code:
out.open("C:\\moviecopyfix.wmv", ios::binary);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top