I'm trying to read a whole line from a file including the spaces in between the data but I can't get it to work. Also, I'm trying to read the blank rows in between the lines, and it's not working neither.
For example, for a data file such as:
Hello, how are you doing?
I hope that you are fine.
I'm trying to read in the entire first line including the spaces in between the words, then I'm trying to return the value of the number of lines in the file which is three for this example, and the number of blank lines which is one. How would I do that?? When I use char string, for example, string only reads up to the first blank, in this case it only reads each word separate and returns a count of words instead of a count of lines. I know that getline can read an entire line, but I don't know how to implement it in a program to read the lines in a file.