my favorite way is using getline(ifstream, string); and then i would just push everything on to a stack of type const char. you could also use vector, list, queue depending on what you need to use it for
That's the gets() that all the C docs warns against using?
From my manpages...
Never use gets(). Because it is impossible to tell without knowing the data in advance how many characters gets() will read, and because gets() will continue to store characters past the end of the buffer, it is extremely dangerous to use. It has been used to break computer security. Use fgets() instead.
after line 9 add another line to call strlen() to get the length of the line just read. If you want all the lines in the file then add them up into an int variable that you can use later in the program.
int sum = 0;
while( fgets(...) ) // replace ... with actual parameters
sum += strlen(text);