Write a function which copies one file to another.Have the f

问题描述:

Write a function which copies one file to another.Have the function throw a file not exist exception if it cannot open the specified file.The function have the following prototype:
int copyfile(const char* source,const char* dest);
Note that the file might be very large,and the content of the file can be text,image,video,audio,and so on.Try to copy the file as quick as possible.
There may be some different exceptions and errors during copy operation,such as null value parameters,file doesn't exist,file stream reads or writes error,and so on.Return an error code to specify which kind of error occurs during copy.
1个回答 分类:综合 2014-10-09

问题解答:

我来补答
在下人工翻的,望有所用~(ps 你是要参加什么编程大赛吗?)
写一个能够复制一份文件到另一份文件的函数(程序).确保这个函数能够投递一份并不存在的文件除非它不能够打开某份特定的文件.这个函数具有以下原型:int copyfile(const char* source,const char* dest);
注意,文件可能会非常大,文件的目录可以被文本化,影像化,视频化,音频化等等.能够尽快的拷贝文件.
当拷贝操作进行时可能会有一些例外和错误,比如无效的量值参数,文件不存在,文件流读写错误,等等.回报一个错误代码以便弄清在拷贝进行中发生的错误种类.
 
 
展开全文阅读
剩余:2000
下一页:数学函数值域