i know the following function is not correct, but its suppose to read a text file(which containts the words "hello all") and pass it to a Vector
called V1 and then encrypt it and pass the encryption to a second vector called V2 and finally output the result into a different text file.that text file should be "ifllp bmm" , which means that the file is being encrypted using ciphers method. Can anyone help me fix it??
void rotate(vector<string> V1, vector<string> V2, int rotKey)
{
string original;
ifstream fin;
fin.open("simple.txt");
string word = V1[0];
word[0];
for (int i = 0; i < V1.size(); i++)
{
char ch = word[i];
ch = tolower(ch);
ch = ch + rotKey;// lets say i want to shift the letter by one to the right
if(ch > 'z')
{
int k = ch -'z';
ch = 'a'+'k' - 1;
}
word[i] = ch;
V2.push_back(word);
}
}