[#bsl-basic_istringstream-getline-04]
= xref:bsl.adoc[bsl]::xref:bsl/basic_istringstream.adoc[basic&lowbar;istringstream]::getline
:relfileprefix: ../../
:mrdocs:

String extraction&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;istringstream&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
&lowbar;&lowbar;istream&lowbar;type&
getline(
    char&lowbar;type* &lowbar;&lowbar;s,
    streamsize &lowbar;&lowbar;n,
    char&lowbar;type &lowbar;&lowbar;delim);
----

== Description

Extracts and stores characters into _&lowbar;&lowbar;s_ until one of the following happens&period; Note that these criteria are required to be tested in the order listed here, to allow an input line to exactly fill the _&lowbar;&lowbar;s_ array without setting failbit&period;

&hyphen;&num; the input sequence reaches end&hyphen;of&hyphen;file, in which case eofbit is set in the stream error state &hyphen;&num; the next character equals `&lowbar;&lowbar;delim,` in which case the character is extracted (and therefore counted in `gcount())` but not stored &hyphen;&num; `&lowbar;&lowbar;n&hyphen;1` characters are stored, in which case failbit is set in the stream error state

If no characters are extracted, failbit is set&period; (An empty line of input should therefore not cause failbit to be set&period;)

In any case, a null character is stored in the next location in the array&period;

== Return Value

&ast;this

== Parameters

[cols="1,4"]
|===
| Name| Description
| *&lowbar;&lowbar;s*
| A character array in which to store the data&period;
| *&lowbar;&lowbar;n*
| Maximum number of characters to extract&period;
| *&lowbar;&lowbar;delim*
| A &quot;stop&quot; character&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
