jpg图像开始标志:FF D8 结束标志 :FF D9
#include<iostream>
#include<fstream>
using namespace std;
class picture{
private:
ifstream ifile_picture;
ifstream ifile_txt;
ofstream ofile_picture;
ofstream ofile_txt;
int length_ifile_picture,length_ifile_txt;
char name_ifile_picture[50], name_ifile_txt[50], name_ofile_picture[50],name_ofile_txt[50];
public:
void Open(ifstream &ifile,char *name,int &length);
void M();
void m();
};
void picture::Open(ifstream &ifile,char *name,int &length)
{
ifile.open(name,ios::binary|ios::in);
if (!ifile)
{
cout<<"Open "<<name<<" failed!"<<endl;
return ;
}
ifile.seekg(0, ios::end);
length = ifile.tellg();
ifile.seekg(0, ios::beg);
}
void picture::M()
{
char *str;
cout<<