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.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *