I am trying to count the number new lines, '\n', in an input file that i am reading using getline(). I think that when you use getline(), the newline character gets overwritten by a NULL character ( '\0'). So how would you count the number of newlines
1 2 3 4 5 6 7 8
while (!read.eof())
{
read.getline(str,100,'\n');
out<<str<<endl; //print the lines to the output file as i get them
}