私は、ファイルをコピーして別の名前として保存するために、ifstream/ofstreamのC++を使用する方法を知りました。別のファイルをコピーするC++
これは私が持っている限りです。私はファイルを取得する方法を知っています。そのファイルをコピーして別の名前で保存する方法はわかりません。
#include<iostream>
#include<fstream>
#include<string>
namespace std;
int main()
{
ofstream
ifstream
cout << "enter your file you want to copy"<< endl;
cin >> input_file_name;
in_file.open(input_file_name);
if (!in_file)
{
cout <<" there is no such file"<<endl;
return 0;
}
cout <<" enter the name you want to save this copy file"<<endl;
cin >> output_file_name;
out_file.open(output_file_name);
if (!out.file)
{
cout<<"file is not available"<<endl;
return 0;
}
in_file.close();
out_file.close();
return 0;
}
あなたのコードは、バイナリ(たとえば、圧縮された)ファイル(複数可)とどうなるのかhttp://coliru.stacked-crooked.com/a/be544185115d1b42 – sehe