std::getline
Template:cpp/string/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td><string>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td >std::basic_istream<CharT,Traits>& getline( std::basic_istream<CharT,Traits>& input,
std::basic_string<CharT,Traits,Allocator>& str
<td > (1) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">
<td >std::basic_istream<CharT,Traits>& getline( std::basic_istream<CharT,Traits>&& input,
std::basic_string<CharT,Traits,Allocator>& str
<td > (1) </td> <td > Template:mark c++0x feature </td> </tr> <tr class="t-dcl ">
<td >std::basic_istream<CharT,Traits>& getline( std::basic_istream<CharT,Traits>& input,
<td > (2) </td> <td class="t-dcl-nopad"> </td> </tr> <tr class="t-dcl ">
<td >std::basic_istream<CharT,Traits>& getline( std::basic_istream<CharT,Traits>&& input,
<td > (2) </td> <td > Template:mark c++0x feature </td> </tr> Template:ddcl list end
Reads in unformatted data from a stream into a string. Stops once a character equal to the delimiter is found, or the stream is exhausted. The first version uses delim
as the delimiter, the second version uses Template:cpp as the delimiter. The delimiter character is discarded from the stream and not placed in the string.
Parameters
input | - | the stream to get data from |
str | - | the string to put the data into |
delim | - | the delimiter character |
Return value
input