I've finished the pset2 Vigenère problem, but encountered unwanted behaviour.
So, I got the plaintext from user input and wanted to copy the value to another variable, which is to be changed further on in order to keep the original input.
string plaintext = get_string(); string ciphertext = plaintext;
But now, after a character in ciphertext is enciphered and changed, the plaintext changes as well.
ciphertext[i] = (((plaintext[i]-ulswitch)+shiftlength)%26)+ulswitch;
Why is that and how can I prevent it? Thanks