void transferData(ifstream& input_file, ofstream& output_file)
{
char ch;
while (!(input_file.eof())) {
input_file.get(ch);
if ((ch >= 97 && ch <= 118) || (ch <= 65 && ch <= 86)) {
ch += 4;
output_file << ch;
}
else if ((ch >= 87 && ch <= 90) || (ch <= 119 && ch <= 122)) {
ch -= 22;
output_file << ch;
} else
output_file << ch;
}
}
I intended for it to change each letter to the one 4 places ahead of it in the alphabet. For some reason, it changes spaces and dots
Text in the input file: "This text is to test the program."
Text in the output file: "lmw$xixx$mw$xs$xiwx$xli$tvskveq26"