.bmp 形式の写真があります。写真の真ん中にテキストを追加したいです。私はすべての seekp と seekg のことを知っていますが、ios::app を使用すると、テキストはファイルの最後に移動し、他のものを使用すると、すべてのテキストが破棄されます。which ios:: ... を使用する必要がありますか?! これが私のコードです:
fstream file;
file.open ("mehdi.bmp" , ios::out | ios::binary | ios::ate);
char name[] = "Mehdi";
file.seekp (100);
file.write ((char*)name , sizeof (name));