So the teacher has posed this assignment:
You have been hired by the United Network Command for Law Enforcement, and you have been given files containing null cyphers yo
Although your queston has been answered, two little tips: 1) Instead of counting x and y to see if you are on an odd or even character you can do the following:
int count=0;
while(!infile.eof())
{
infile.get(letter);
count++;
if(count%2==0)
{
cout<
% essentially means 'remainder when divided by,' so 11%3 is two. in the above it gives odd or even.
2) Assuming you only need to run it on windows:
system("pause");
will make the window stay open when its finished running so you don't need the last getchar() call (you may have to #include for that to work).