I've been trying to get back into learning c++ again. I'm having trouble with this. When I run this, everybody works except that when I select 1 for encryption, it only does the cout statements then exits. If I comment everything else out and just call encrypt () in main, the function works perfectly. I don't get it. Is this not correct?
You're using cin >> choice, which reads an integer.
Your input is an integer and a RETURN.
After cin >> choice, there's a RETURN in the input buffer.
getline reads till RETURN.
You get nothing :)
How to solve: call getline after cin, and then call encrypt.