Re: Having trouble with a readin. Can't read in a matrix into vector of vector of int
Correct, getline will read each line in a file until there are no more lines. What is likely happening is that your file has a blank line in it. So, it successfully reads the blank line. You then create the tempVec. The inner while loop fails (because >> ignores whitespace, but the stream has nothing in it), but you still have a vector, so it is added to your main vector. You can do a quick check to make sure that the vector you are adding to nums has a nonzero size.