To read an entire string from a file, instead of a single character, use the _______ function.
- getline
- read
- fetch
- getString
The getline function is used in C++ to read an entire line from an input stream, such as a file. This is particularly useful when dealing with strings that have spaces or when reading full sentences.
Loading...
Related Quiz
- In the context of operator overloading, the expression a + b is equivalent to _______.
- Which of the following statements about the struct and class keywords is true?
- How does a range-based for loop work in C++11 and above?
- The friendship granted by a class A to a function or class B is _______ reciprocal, meaning [choose the correct statement].
- To handle an exception thrown, a _______ block is used to catch the exception.