You're providing a small snippet of code without context. Please provide a minimal code sample that reproduces the problem you're experiencing to get cogent advice about your code when presenting an issue.
I would guess that you are now mixing formatted and unformatted extraction from the input stream, but it's just an educated guess.
Try: getline((cin >> ws), kon); which will remove any stray newline hanging around in the input stream prior to calling getline.
The "function ken()" works fine for me. Without knowing what you did in "main" it is hard to know what might be causing the problem.
Something you could try before the getline: std::cin.ignore( std::numeric_limits<std::streamsize>::max(), '\n' ); and at the top of the file include this:
1 2
#undef max
#include <limits>
these lines are best put at the end of your includes.
I have not seen cire's suggestion before, but that would work too.