I have two arrays of the alphabet which have been sorted in two different ways and in the order i need. now i need to replace, in order, the first letter in indexb[] with the first letter in indexa[] all the way to the 26th letter of them both. i have used the replace() function to then change the letters in the text that i need to swap the letters for and then output the message with all the swaps. but the code is not swapping the right letters i want swapping. any advice?
char c;
vector<char> fileChars;
while (code.good())
{
code.get(c);
fileChars.push_back(c);
}
for (int i = 0; i < 26; i++)
{
replace(fileChars.begin(), fileChars.end(),indexb[i],indexa[i]);
}
for (int i = 0; i < fileChars.size(); i++)
{
decrypted<< fileChars[i];
}
std::string?