Is ThIs Ok...
Code:
#include<stdio.h>
#include<stdlib.h> /* for exit() function */
#include<ctype.h>
int main()
{
char ch;
FILE *in_ptr, *out_ptr;
if((in_ptr=fopen("infile.txt","rt"))==NULL)
{
printf("CANNOT OPEN INFILE TO READ - PROGRAM STOPPED!");
exit(1);
}
if((out_ptr=fopen("outfile.txt","wt"))==NULL)
{
printf("CANNOT OPEN OUTFILE TO WRITE - PROGRAM STOPPED!");
exit(1);
}
while((ch=fgetc(in_ptr))!=EOF)
fputc(tolower(ch),out_ptr);
fclose(in_ptr);
fclose(out_ptr);
printf("EnD oF pRoGrAm!\n\nNoW LoOk At ThE cOnTeNtS oF oUtFiLe.TxT\n"
"WiTh A tExT eDiToR... oR wRiTe AnOtHeR pRoGrAm To DiSpLaY iT tO\n"
"tHe ScReEn!!\a");
return 0;
} /* end main */
/* Create a test file "infile.txt" for the A:drive, or other directory as preferred:
"hI, sarAH! I HOPE I DON'T upset anybody by doing YOUR homework! HaVe yOU dEAlt with files bEForE!? Bye from BADGER..."
*/
Cheers from MiStErBaDgEr