Help correcting a caesar cipher function

I'm almost done with a program to decrypt text from both caesar and substitution type ciphers. My program is supposed to read the first integer in a text file and use that as a shift. I have the substitution function working without a hitch. For some reason the output in my caesar function is coming out really strange, not sure what part of the function is in error. Whole program compiles fine. Below is the code for my function


void Caesar_Conversion_function (){
cout<<"Input File name:";
string input_file;
cin>> input_file;
ifstream inFile(input_file);


int ciphervalue; // hold cipher subtraction value
inFile >> ciphervalue; // grab cipher subtraction value from file
char Alphabet_letters; // hold character value
while (inFile.get(Alphabet_letters)){ // while reading characters

typedef char Alphas [26]; // typedef for char array
Alphas Alphabet = {'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'};
char converted;
for (int count = 0; count <= 26; count++){ //Step through Array and subtract cipher number

if (Alphabet_letters==Alphabet[count]){

converted = Alphabet[count-ciphervalue];
// output converted chars
}


}
cout << converted;
}
}
1
2
3
4
5
6
7
8
9
10
typedef char Alphas [26];	 // typedef for char array
Alphas Alphabet = {'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'}; 
char converted;
for (int count = 0; count <= 26; count++){ //Step through Array and subtract cipher number

if (Alphabet_letters==Alphabet[count]){

converted = Alphabet[count-ciphervalue];
// output converted chars
}	


Why not simply iterate over the string doing this:
1) check if it is a letter
2) if 1 is false goto step 4
else make the letter uppercase and add the shift
3) if the shift is positive(right) and greater than 'Z' subtract 26
if the shift is negative(left) and less than 'a' add 26.
4)move to next character


Here is a simple example of a shift cipher I helped someone with earlier. There are numerous approaches you can do though.
http://www.cplusplus.com/forum/beginner/128695/
Topic archived. No new replies allowed.