This is wrong, and I'll explain why.
cin >> password;
getline(cin, password ,'\n');
Input to your program is buffered. When you type in your password, it might look like this:
The first line you have will read until it hits '\n' in this case. Reading strings with cin, however, means that the '\n' char is left in the input buffer. That means the input buffer will look like this:
'l', 'a', 'l', 'a', '\n'....
getline() comes around and tries to read now. It reads into the same location you had cin read to. It reads this as an empty string and the output buffer is now empty because getline(), unlike cin, will eat up the '\n' char and discard it.
Your variable password is now an empty string, not "lala".
Solution: Get rid of the first line.