读取不同类型的文件 [英] Reading different kind of files

查看:92
本文介绍了读取不同类型的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用C程序读取不同类型的文件(例如:.txt,.doc,.exe等...),并以不同的名称创建具有相同格式的相同文件?

How to read different kind of files (eg:- .txt,.doc,.exe etc...) using c program and create the same file with same format in different name?

推荐答案

使用二进制方法复制它们...看一下此链接 [ ^ ] ...我想它应该对您有帮助...

希望这对您有帮助...
Copy them using binary method... Take a look at this link[^]... I guess it should help you...

Hope this helps...


每个平台都有自己的库来处理文件操作.根据平台的不同,您可能不必为此编写一行代码.如果您的目标是Windows,请查看CopyFile API http://msdn.microsoft.com/zh-cn/library/aa363851(v = vs.85).aspx.
Each platform has it‘s own library for dealing with file operations. Depending on the platform, you probably don‘t have to write more then a single line of code for this. Have a look at CopyFile API http://msdn.microsoft.com/en-us/library/aa363851(v=vs.85).aspx if you are targeting Windows.


您永远不需要以不同的名称创建具有相同格式的相同文件".您可以复制它,但是几乎不需要.为什么会这样呢?

—SA
You never need to "create the same file with same format in different name". You can copy it, but even that is hardly needed. Why indeed?

—SA


这篇关于读取不同类型的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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