Top "Getline" questions

A C function that reads an entire line from a stream.

Going through a text file line by line in C

I have been working on a small exercise for my CIS class and am very confused by the methods C …

c getline scanf
Why is reading lines from stdin much slower in C++ than Python?

I wanted to compare reading lines of string input from stdin using Python and C++ and was shocked to see …

python c++ benchmarking iostream getline
Using getline() in C++

I have a problem using getline method to get a message that user types, I'm using something like: string messageVar; …

c++ string getline
When and why do I need to use cin.ignore() in C++?

I wrote a very basic program in C++ which asked the user to input a number and then a string. …

c++ cin getline ignore
reading a line from ifstream into a string variable

In the following code : #include <iostream> #include <fstream> #include <string> using namespace std; int …

c++ string ifstream getline
c++ Read from .csv file

I have this code which is supposed to cout in console the information from the .csv file; while(file.good()) { …

c++ file csv getline
cin and getline skipping input

earlier i posted a question about cin skipping input, and I got results to flush, and use istringstream, but now …

c++ input getline cin
Using getline() with file input in C++

I am trying to do a simple beginner's task in C++. I have a text file containing the line "John …

c++ getline
C++: Using ifstream with getline();

Check this program ifstream filein("Hey.txt"); filein.getline(line,99); cout<<line<<endl; filein.getline(line,99); …

c++ file-io fstream getline
checking for eof in string::getline

How do I check for end-of-file using the std::getline function? If I use eof() it won't signal eof until …

c++ file-io getline