I\'m sorry but I\'m quite new to C++ but not programming in general. So I tried to make a simple encryption/decryption. However when I added the modification to my previous code
This is because you still have the newline character in the buffer which makes getline()
stop reading as soon as it encounters it.
Use cin.ignore()
to ignore the newline character from the buffer. This will do in your case.
In general, if you want to remove characters from your buffer untill a specific character, use:
cin.ignore ( std::numeric_limits::max(), ch )