I'm having a problem with getline() in the simple code below, and I was wondering if you could take a look at it. I am trying to read the first 5 char's from each line of an input file that looks like this:
but, my output is:
I can't figure out what's going on with getline() or the file pointer, so I put a tellg() statement in after the first read of 5 char's, and I get tellg() = -1???
using namespace std;
//discard the rest of the char's on the line
//read the first 5 char's on the next line