python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
A problem with cin after a getline makes my while loop never end at the second iteration in c++
If I replace the getline for a cin, just as a test, it works as I want. But the moment I introduce the getline it creates a never-ending loop at the second iteration. I think it has something to be wi...
Facundo Borrás
Votes: 0
Answers: 1
how does getline() read a multiple-line file in loops?
I have some confusion about the use of std::getline function. see the following code:
#include <sstream>
#include <string>
std::ifstream ifs(filename);
std::string line;
while (std::getli...

kaiyu wei
Votes: 0
Answers: 1
fgetc vs getline or fgets - which is most flexible
I am reading data from a regular file and I was wondering which would allow for the most flexibility.
I have found that both fgets and getline both read in a line (one with a maximum number of charact...
tintins7a6164
Votes: 0
Answers: 2