简体   繁体   English

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

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

Hello I don't success to append "myText" at end end of the photo file. 您好,我没有成功在照片文件的末尾添加“ myText”。

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

It doesn't works... It does not append "textAdded" at the end of the binary file... 它不起作用...不会在二进制文件末尾附加“ textAdded” ...

Try adding photo.close(); 尝试添加photo.close(); on a new line after what you have written 写完之后换行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM