| Статья :: Скопировать файл построчно |
#include <stdio.h>
void main() {
const int n = 100;
char buf [n];
FILE *in = fopen (in_file,r);
FILE *out = fopen (out_file,w);
if (!in) return;
while (!feof(in)) {
fgets(buf, n, in);
fputs(buf, out);
}
fcloseall();
}
|
|
|