BigSadBear
October 6th, 2005, 02:36 AM
Well, I have this problem: I want to read a file, get the size, and read all symbols. Then I do some stuff with the data and I`m trying to write it in file. But the program is adding another 65 symbols at the end of the file. The file is 6151 symbols long. Here is the code:
long file_size;
//here it reads the file_size - I`m sure it`s OK
unsigned char* input=new unsigned char[file_size]; //def. and init. the pointer
for(i=0; i<size; i++){
input[i]=in.get();
}
//and then do something to the data........
//then write it in file
for(int i=0;i<size;i++) out_file<<input[i];
So...any suggestions. Thanks!
long file_size;
//here it reads the file_size - I`m sure it`s OK
unsigned char* input=new unsigned char[file_size]; //def. and init. the pointer
for(i=0; i<size; i++){
input[i]=in.get();
}
//and then do something to the data........
//then write it in file
for(int i=0;i<size;i++) out_file<<input[i];
So...any suggestions. Thanks!