#include <stdio.h>

main (int argc, char *argv[])
{
	int ch;
	FILE *infp, *outfp;

	if (argc < 3)
	{
		fprintf(stderr, "Usage: <input> <output>\n");
		exit(0);
	}

	if ((infp = fopen(argv[1], "r")) == NULL)
	{
		fprintf(stderr, "Unable to open input file %s\n",argv[1]);
		exit(1);
	}

	if ((outfp = fopen(argv[2], "w")) == NULL)
	{
		fprintf(stderr, "Unable to open output file %s\n",argv[2]);
		exit(1);
	}

	while ((ch = fgetc(infp)) != EOF)
	{
		fputc(ch, outfp);
	}

	fclose(infp);
	fclose(outfp);
	exit(0);
}
