Subj : cin.get() leaves a '\n' To : borland.public.cpp.borlandcpp From : Thomas Rausch Date : Tue Sep 02 2003 11:02 am Hallo, ( Borland C++ Free Compiler 5.5.1, Windows 95/DOS Commandline. ) writing a menue, I got an error. The little programm-fragment shows it: #include #include using namespace std; int main() { char c; string name,telNr; cout << "Enter a character: "; cin.get(c); cout << "Name: "; getline(cin,name); cout << "Telefonnummer: "; getline(cin,telNr); return 0; } The compiler does not execute "getline(cin,name);". It seems, that the "cin.get(c);" leaves a '\n' in the buffer. I tried to flush the buffer with "cin.sync();" without success. So I took "cin.ignore();". That worked. But this is not a good solution. Is it a known bug in the cin.get()-function ? Who knows, what to do ? Greetings Thomas .