Ummm... fgetc returns an int... check it out in your library documentation.
There should be no reason to make copies of the existing variables, C is perfectly capable of comparing characters. A character is simply a short short int... usually 8 bits wide, or one byte. You can add, subtract, multiply and divide with chars just like you do with shorts, ints, long ints and long long ints. There's no magic...
Now let me tell you this one more time... stop trying to reopen files to do single tasks, it's a disaster waiting to happen... First consider that your output file is all upper case... what happens if the user types a lower case character? Yeah that's right, the test fails...
Look closely at where I am doing this.... (from your original code posting)
The problem here is that you are adding something new... but ignoring the chance to integrate it into your *existing* code...
FILE *fpin, *fpout, *fprec; // declares two file streams, in and out
int tl, f, i=0;
char ch, let=0; // ch is variable to be used in conversion
char input, output, record; // declared arrays to store file paths
printf("Input input file name: \n");
gets(input); // input file location
printf("Input output file name: \n");
gets(output); // output file location
printf("Input record file name: \n");
gets(record); // record file location
printf("Which letter would you like the frequency of?\n");
if((fpin = fopen(input,"r")) == NULL) // confirms that file has been opened
printf("Unable to open input file");
if((fpout = fopen(output,"w")) == NULL) // confirms that file has been created
printf("Unable to open output file\n");
while((ch=getc(fpin))!=EOF) // read input file until the end of the file
if (let == ch)
if((ch>='a' && ch<='z') | (ch>='A' && ch<='Z')) // ensures that only alphabetic characters are transferred
putc(toupper(ch), fpout); //function to change all the characters to upper case
fclose(fpin); // close input file
if((fprec = fopen(record,"w")) == NULL) // confirms that file has been created
printf("Unable to open record file\n");
printf("Total number of letters in the file: %d\n", tl);