#include <iostream.h>
#include <iomanip.h>
#include <fstream.h>
void error(char *s, char *s2="")
{
cerr << s << ' ' << s2 << '\n';
exit(1);
}
void main(int argc, char *argv[])
{
char buf[1024];
ifstream in; ofstream out;
in.open(argv[1], ios::in);
if (!in) error("Can't read from", argv[1]);
out.open(argv[2], ios::out);
if (!out) error("Can't write to", argv[2]);
while(in.getline(buf, 1024, '\n') && !in.eof())
{
out << buf << endl;
}
in.close(); out.close();
}
| © 1997 Gottfried Rudorfer, C++-AG, Lehrveranstaltungen, Abteilung für Angewandte Informatik, Wirtschaftsuniversität Wien, 1/11/1999 |