I've written a program that reads and prints text files that the user has chosen. I now want the program to encrypt the text in the file and for the user be able to choose the alphabetic shift. Could someone please show me how to do this? Here is what i have so far:
#include <stdio.h>

int main(void) {
FILE *file_in;
char filename[20];
char ch;
int shift;
// file_in is the name given to the stream. filename will be the file that the user chooses. ch is the characters in the file.

printf("What file do you want to open?: ");
	file_in=fopen(filename, "r");
	//ask the user to enter the name of a file

printf("Error! File did not open.\n");
	//print message if the file can not be found

while((ch=fgetc(file_in)) != EOF) 
	//prints the results on the screen and shows the end of the file
	//closes stream