#include <stdio.h>

int main(void)
{
	FILE *fpSource, *fpDest;
	char sname[FILENAME_MAX], dname[FILENAME_MAX];
	char c;

	printf("Enter name of source file: ");
	scanf("%s", sname);


	printf("Enter name of destination file: ");
	scanf("%s", dname);

	fpSource = fopen(sname, "r");
	if (fpSource == NULL)
	{
		printf("Error opening source file!\n");
		return 1;
	}


	fpDest = fopen(dname, "w");
	if (fpDest == NULL)
	{
		printf("Error opening destination file!\n");
		return 1;
	}


	while ((c = getc(fpSource)) != EOF)
		putc(c, fpDest);


	fclose(fpSource);
	fclose(fpDest);

	return 0;
}
