files
hi there,
I am studying about jpeg format. I want to display picture with jpeg format from its data file.
Other one is that, what is faulty in that program code. I am trying to declare a class. Why i can not initialize ifstream gird, ofstream cikd? Can you help me?
#include <fstream.h>
#include <iostream.h>
#include <iomanip.h>
class resim
{
public:
ifstream &gird;
ofstream &cikd;
char *baslik;
resim();
bool oku(ifstream &gird,ofstream &cikd);
};
resim::resim()
{
ifstream gird("600.jpg",ios::in|ios::binary);
ofstream cikd("karis.dat");
}
bool resim::oku(ifstream &gird,ofstream &cikd)
{ short a;
if (!gird) {
cout<<"HATA ! dosya açýlamadý"<<endl;
return false;
}
while (!gird.eof()){
gird.read((char *) &a,2);
cikd<<hex<<a; }
return true;
}
int main()
{
resim ben;
if (!ben.oku(ben.gird,ben.cikd)) { cout<<"HATA ! okuma olmadý"<<endl;
return 1;
}
return 0;
}
|