getline

Extracts characters from a stream and appends them to a string.

  template <class charT, class traits, class Allocator>

  basic_istream<charT,traits>& getline

  (basic_istream<charT,traits>& is,

  basic_string <charT,traits,Allocator>& str,charT delim);

  template <class charT, class traits, class Allocator>

  basic_istream<charT,traits>& getline

  (basic_istream<charT,traits>& is,

  basic_string<charT,traits,Allocator>& str)  
Remarks

Extracts characters from a stream and appends them to the string until the end-of-file occurs on the input sequence (in which case, the getline function calls setstate(eofbit) or the delimiter is encountered in which case, the delimiter is extracted but not appended.

If the function extracts no characters, it calls setstate(failbit) in which case it may throw an exception.