ファイル名 | 説明 |
---|---|
file2.cpp | ファイルのコピー |
ifstream i_f; //入力ファイルの宣言 ofstream o_f; //出力ファイルの宣言 i_f.open("file2.cpp",ios::in); if (!i_f) { cerr << "ファイル" << "file2.cpp" << "オープンエラー\n"; return(1); } o_f.open("w.txt",ios::out); if (!o_f) { cerr << "ファイル" << "w.txt" << "オープンエラー\n"; return(1); } copyfile(i_f,o_f); |