Hello,
I was just curious how blank lines are handled when using getline? Say I have a text file as follows:
And I have some simple code like this:Line of text
Line of text again
What would I put in the "blank" spot to test if the line that was retrieved was blank? Thanks.Code:#include <iostream> #include <string> using namespace std; int main() { string line; while (getline(cin,line) ) if (line == blank) cout << "A blank line!" << endl; }