cpp/io/basic istream/getline

Extracts characters from stream until end of line or the specified delimiter.

The first overload is equivalent to.

Behaves as. After constructing and checking the sentry object, extracts characters from and stores them in successive locations of the array whose first element is pointed to by, until any of the following occurs (tested in the order shown):


 * 1) end of file condition occurs in the input sequence.
 * 2) the next available character  is the delimiter, as determined by . The delimiter is extracted (unlike ) and counted towards gcount, but is not stored.
 * 3)  is non-positive, or  characters have been extracted ( is called in this case).

If the function extracts no characters, ​ is set in the local error state before is called.

In any case, if, it then stores a null character into the next successive location of the array and updates gcount.