#include <iostream>
#include <fstream>
#include <cstdlib>
#include <conio.h>
using namespace std;
int main() {
char c;
fstream fnguon;
fnguon.open("DATA1.dat", ios::in | ios::binary);
fstream fdich;
fdich.open("DATA", ios::out | ios::binary);
char buf[2000];
int n = 2000;
while (n) {
fnguon.read(buf, 2000);
n = fnguon.gcount();
fdich.write(buf, n);
}
fnguon.close();
fdich.close();
cout << n;
_getch();
}
//Mình không hiểu cách dùng phương thức write và read , gcount trong chuong trình trên , ai hiểu giải thích cho t vs! t cảm ơn!
83% thành viên diễn đàn không hỏi bài tập, còn bạn thì sao?