[ create a new paste ] login | about

Link: http://codepad.org/fVYhYPVv    [ raw code | output | fork ]

C, pasted on Dec 19:
#include<stdio.h>
#include<conio.h>

void transFile(FILE* inFile, FILE* outFile)
{
	int ch;
	while(1)
	{
		ch = fgetc(inFile);
		if(!feof(inFile))
		{
			fputc(ch, outFile);
		}
		else
			break;
	}
}
void main()
{
	FILE *fpIn;
	char* fname = "Data.txt";
	fpIn = fopen(fname,"rt");
	if(fpIn == NULL)
	{
		printf("FIle %s not found\n", fname);
	}
	transFile(fpIn, stdout);
	fclose(fpIn);

	getch();
}


Output:
1
2
3
Line 17: error: conio.h: No such file or directory
In function 'main':
Line 19: warning: return type of 'main' is not 'int'


Create a new paste based on this one


Comments: