I have got a file that contains data for multiple jpegs (along with some garbage), i need to extract binary from this file, filter out the garbage and create jpegs. I know the starting binary sequence of the jpegs.
char buffer[30];
ifstream fin;
fin.open ("FILENAME.raw", ios::in | ios::binary);
while (!fin.eof())
{
fin.read(buffer,30);
cout<<buffer[2]<<endl;
}
fin.close();
Here i am trying to print the file in binary but, when i run this code, alien characters are printed on the screen.