asked 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.

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.

Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.