My professor in his grading robot decided to put a unicode character in a ciphering program and my code really doesnt like it at all. Can anyone help me without using loops?
//
//Caesars Cipher
//program encrypts a file using caesars cipher
//Due 9/9/11
//created 9/9/11
//last modified 9/9/11
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
//Define Variable
char ch;
//Open files
ifstream infile;
ofstream outfile;
infile.open("program2.bat");
outfile.open("message");
//get character and convert
cout << ch;
infile >> ch;
ch=(ch-3);
//print chracter to screen
cout << ch;
//send char to message
outfile<<ch;
//repeat 11 times
infile >> ch;
ch=(ch-3);
cout << ch;
outfile<<ch;
infile >> ch;
ch=(ch-3);
cout << ch;
outfile<<ch;
infile >> ch;
ch=(ch-3);
cout << ch;
outfile<<ch;
infile >> ch;
ch=(ch-3);
cout << ch;
outfile<<ch;
infile >> ch;
ch=(ch-3);
cout << ch;
outfile<<ch;
infile >> ch;
ch=(ch-3);
cout << ch;
outfile<<ch;
infile >> ch;
ch=(ch-3);
cout << ch;
outfile<<ch;
infile >> ch;
ch=(ch-3);
cout << ch;
outfile<<ch;
infile >> ch;
ch=(ch-3);
cout << ch;
outfile<<ch;
infile >> ch;
ch=(ch-3);
cout << ch;
outfile<<ch;
infile >> ch;
ch=(ch-3);
cout << ch;
//close files
infile.close();
outfile.close();
return 0;
}