- 3
Describe different methods of operating a file in C ++. Also , example different file open modes.
write a program to copy'first.txt' file to' second.txt' file.
1 ответ
+ 3
#include <fstream>
using namespace std;
int main() {
ifstream in("first.txt", ios::binary);
ofstream out("second.txt");
char c;
while(in.read((char*) &c, sizeof c))
out << c;
in.close();
out.close();
}