C++ 如何在图片文件的末尾附加字符串

C++ How to append a string at the end on a picture file?

本文关键字:字符串 文件 C++      更新时间:2023-10-16

您好,我没有成功在照片文件的末尾附加"myText"。

ofstream photo;
photo.open("photo.jpg",ios::app);
photo << endl << "textAdded";

它不起作用...它不会在二进制文件的末尾附加"textAdd"...

尝试在你写的内容之后的新行中添加 photo.close();