equal
deleted
inserted
replaced
5 |
5 |
6 #include <iostream> |
6 #include <iostream> |
7 #include <fstream> |
7 #include <fstream> |
8 #include <cstdlib> |
8 #include <cstdlib> |
9 |
9 |
10 int main(int argc, char **argv) |
10 int main (int argc, char **argv) |
11 { |
11 { |
12 std::ifstream in; |
12 std::ifstream in; |
13 std::ofstream out; |
13 std::ofstream out; |
14 |
14 |
15 char c; |
15 char c; |
16 |
16 |
17 if ( argc != 3 ) { |
17 if (argc != 3) { |
18 std::cout << "Benutzung: " << argv[0] << " <datei> <datei>" << std::endl; |
18 std::cout << "Benutzung: " << argv[0] << " <datei> <datei>" << std::endl; |
19 return EXIT_SUCCESS; |
19 return EXIT_SUCCESS; |
20 } |
20 } |
21 |
21 |
22 in.open(argv[1], std::ios::binary); |
22 in.open (argv[1], std::ios::binary); |
23 if ( !in ) { |
23 if (!in) { |
24 std::cerr << "Fehler: Kann Datei " << argv[1] << " nicht lesen!" << std::endl; |
24 std::cerr << "Fehler: Kann Datei " << argv[1] << " nicht lesen!" << std::endl; |
25 } |
25 } |
26 |
26 |
27 out.open(argv[2]); |
27 out.open (argv[2]); |
28 if ( !out ) { |
28 if (!out) { |
29 std::cerr << "Fehler: Kann Datei " << argv[2] << " nicht beschreiben!" << std::endl; |
29 std::cerr << "Fehler: Kann Datei " << argv[2] << " nicht beschreiben!" << std::endl; |
30 } |
30 } |
31 |
31 |
32 while ( in.get(c) ) { |
32 while (in.get (c)) { |
33 out << c; |
33 out << c; |
34 } |
34 } |
35 |
35 |
36 in.close(); |
36 in.close (); |
37 out.close(); |
37 out.close (); |
38 |
38 |
39 return EXIT_SUCCESS; |
39 return EXIT_SUCCESS; |
40 } |
40 } |