#include<stdio.h> #include<stdlib.h> #include<ctype.h> #include<conio.h> void main() { FILE *file_in; FILE *file_out; char apple[200]; char fname[100]; char cipher[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; printf("please enter the file which you would like to open and encrypt:"); scanf( "%s", fname); file_in = fopen(fname, "r"); int i=0; while (!feof(file_in)) { fscanf(file_in,"%c",&apple[i]); i++; } apple[i] = 0x00; printf("\n%s\n", apple); printf("\nplease enter the file which you would like to write to and encrypt:"); scanf( "%s", fname); file_out = fopen(fname, "w"); fprintf(file_out,"%s\n", apple); file_out = fopen(fname, "r"); printf("\n%s\n", apple); fclose(file_out); fclose (file_in); getch(); } |