istream& getline ( istream& is, string& str, char delim );
istream& getline ( istream& is, string& str );
Get line from stream
Extracts characters from is and stores them into str until a delimitation character is found.
The delimiter character is delim for the first function version, and '\n' (newline character) for the second. The extraction also stops if the end of file is reached in is or if some other error occurs during the input operation.
If the delimiter is found, it is extracted and discarded, i.e. it is not stored and the next input operation will begin after it.
Notice that unlike the c-string versions of istream::getline, these string versions are implemented as global functions instead of members of the stream class.
Partager