getline

getline check if line is whitespace

Is there an easy way to check if a line is empty. So i want to check if it contains any white space such as \r\n\t and spaces. Thanks ...

Input after cin.getline() fails?

I am new to programming. In my textbook, the problem presented it to write a program that asks a user for the rainfall for three months and calculates the average. I used the cin.getline() function to read the user input into an array. The text states that there is no worry of the array being overflowed using the cin.getline() functio...

getline function reading random characters not in the file; two random characters are read along with the data in the notepad keyword.txt

#include "keywords.h" #include <iostream> #include <fstream> #include "llist.h" #include <string> using namespace std; //default constructor List<string> L; keywords::keywords(){ } void keywords::open_file(string filename) { input.open(filename.c_str()); } void keywords::close_file(){ input.close(); } void keywords::load() { ...