我想讀取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