http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351

If that getline is C++'s getline, you're using it wrong.

http://www.cplusplus.com/reference/string/getline.html