将数据插入文件的中间。 [英] Insert Data Into Middle Of The File.

查看:75
本文介绍了将数据插入文件的中间。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计。

我正在使用c语言。在c语言中,我正在使用文件处理将数据插入到文件的中间。文件格式可以是.txt,.dat,.binary文件。 plz为我提供了易于理解的代码。

解决方案

要插入文件中间,你必须:

  1. 读取内存缓冲区中的文件内容。
  2. 修改内存缓冲区。
  3. 将修改后的缓冲区内容写回文件。



你可能会发现很多 C 文件 I / O 教程,只是< a href =https://www.google.co.uk/#q=C+how+to+read+and+write+a+binary+file> Google搜索 [ ^ ]


Hey guys.
I'm working with c language.in c language i am using file handling to insert data to middle of the file. file format can be like .txt,.dat,.binary file. plz suggest me easy n understandable code for this topic.

解决方案

To 'insert in the middle of the file', you have to:

  1. Read the file content in a memory buffer.
  2. Modify the memory buffer.
  3. Write back the modified buffer content to the file.


You might find many C file I/O tutorials, just Googling for[^].


这篇关于将数据插入文件的中间。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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