blob: 4657033fd2a8df2f9ce795758dc10651c3e0a594 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include <cstdlib>
#include <fstream>
int main(int argc, char *argv[])
{
if (argc != 3)
return EXIT_FAILURE;
std::ifstream in(argv[1]);
if (!in)
return EXIT_FAILURE;
std::ofstream out(argv[2]);
if (!out)
return EXIT_FAILURE;
char ch;
while (in.get(ch))
out.put(ch);
return in.eof() && out ? EXIT_SUCCESS : EXIT_FAILURE;
}
|