can you help me complete this program...
it is an encryption program..
it needs another text file(1), that will convert the the contents of text file(#2) and then save it to another text file(#3)..it needs 3 text file..how can i do that??
#include<stdio.h>
#include<ctype.h>
#include<stdlib.h>
#include<iostream.h>
void main(void)
{
FILE *inputf;
FILE *encrypt;
char c;
int ch;
char encryptfilename[20];
char output[20];
cout<<"Input name of textfile to encrypt: ";
cin>>encryptfilename;
if((inputf=fopen(encryptfilename,"r"))==NULL)
{
cout<<"Error:filename cannot be opened \n";
exit(0);
}
cout<<"Input name of encrypted textfile: ";
cin>>output;
if((encrypt=fopen(output,"w"))==NULL)
{
cout<<"Error \n";
exit(0);
}
c=fgetc(inputf);
cout<<"\nThe file is encrypted";
while(c!=EOF)
{
ch=0;
ch=ch+c;
ch=ch/2;
c=c+ch;
fputc(c,encrypt);
c=fgetc(inputf);
}
fclose(inputf);
fclose(encrypt);
}