Hi
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:
Code:
#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?: ");
gets(filename);
	file_in=fopen(filename, "r");
	//ask the user to enter the name of a file

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

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