Error using getline

After I enter my guess the program ends. It used to reply donkey before, but when I use getline I am getting an error. What am I missing in my code?

I restarted my pc and ran the code again and everything works.

Privacy & Terms