89.6k views
2 votes
C++ Standard Library function ________, from the header, reads characters up to, but not including, a newline, which is discarded, then places the characters in a string.

User Grasingerm
by
5.3k points

1 Answer

5 votes

Answer:

getline()

Step-by-step explanation:

The getline() function in C++ programming language is found in the standard library belonging to the <string> header. It does a job similar to java's input.nextLine() method in the Scanner class which is to read a line of input and store in a String Variable. When this function is executes successfully, it will return a string comprising of characters including the newline but not with the terminatin null.

User Tuukka Haapaniemi
by
5.5k points