我想读取C++(Turbo)中的bmp文件。但我无法打印二进制流。阅读bmp文件的隐写术
我想编码txt文件并解密它。 我该如何做到这一点。我读了那个bmp文件头是54字节。但是如何以及在哪里应该在bmp文件中追加txt文件。 ?
我只知道Turbo C++,所以如果你提供相同的主题相关的解决方案或建议,对我来说将是有益的。
int main()
{
ifstream fr; //reads
ofstream fw; // wrrites to file
char c;
int random;
clrscr();
char file[2][100]={"s.bmp","s.txt"};
fr.open(file[0],ios::binary);//file name, mode of open, here input mode i.e. read only
if(!fr)
cout<<"File can not be opened.";
fw.open(file[1],ios::app);//file will be appended
if(!fw)
cout<<"File can not be opened";
while(!fr)
cout<<fr.get(); // error should be here. but not able to find out what error is it
fr.close();
fw.close();
getch();
}
该代码运行正常,当我以二进制模式传txt文件
编辑:
while(!fr)
cout<<fr.get();
我无法看到控制台 这是工作的罚款二进制数据(c)
到底在说什么?隐写术? – SLaks 2010-03-21 20:18:18
@Slaks是的我在谈论隐写术 – 2010-03-21 20:20:29
你的问题没有任何意义 - 你可能需要在试图编写任何代码之前再阅读一下隐写术。 – 2010-03-21 20:27:26