我想将文件从一个位置复制到使用C程序的不同位置,任何一个可以给我一个提示,我该怎么办呢?C程序将文件复制到一个位置
我成为这个,我不知道,即时通讯使用代码块编译和编写程序。
// Please help me out... I have only included some files such as:
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <dir.h>
#include <dos.h>
#include <io.h>
int main()
{
}
帮帮我。
最终你可以以某种方式调用unix'cp'命令... – evotopid 2012-04-03 15:40:27
你想使用系统调用吗?如果不是,您可以打开要复制的文件,在所需的目录中用相同的名称创建一个新文件,读取第一个文件中的所有数据并将其写入第二个文件。这个http://www.cplusplus.com/reference/clibrary/cstdio/FILE/显示了如何使用'stdout'来完成,你必须改变到另一个文件。 – twain249 2012-04-03 15:44:55
也许在Windows上,(dos.h)。除非你仍然在Windows 95上,否则转储该dos.h并包含windows.h。调用copyfile()API。 – 2012-04-03 15:45:43