C++文件复制

 1 #include <fstream>
 2 
 3 void CopyFile(const char* dst_file, const char* src_file)
 4 {
 5     std::ofstream dst(dst_file);
 6     std::ifstream src(src_file);
 7 
 8     if(!dst.is_open() || !src.is_open())
 9     {
10         LOGD("File open failed, check the file path");
      
11 } 12 13 dst << src.rdbuf(); 14 }
posted @ 2019-12-12 09:38  Cristiano-Duan  阅读(434)  评论(0编辑  收藏  举报