如何在C ++中使用文件处理从文件中删除数据? [英] How I Delete Data From File Using File Handling In C++?

查看:504
本文介绍了如何在C ++中使用文件处理从文件中删除数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何从文件中删除dta ....

例如我想删除一些购物商城的产品...

我怎么能这样做? ???

how i delete dta from file ....
for example i want to delete some product of shoping mall...
how i can do it?????

推荐答案

按照建议,你不能删除文件内的数据。您必须读取文件,在内存中执行所需的修改,然后将内存内容写回文件。场景可能更复杂,也不简单。
As suggested, you cannot remove data inside of a file. You have to read the file, preform the required modifications in memory and then write back the memory content to the file. The scenario could be more complex, not simpler.


这篇关于如何在C ++中使用文件处理从文件中删除数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆