readin newline \n from file

i am making a program of calculating frequency of each word in a text file..which i have done successfully.but i also want to calculate no.of newlines in text..how can i read newline from textfile.
How do you parse your file?

I suggest to use std::getline() and parse each string individually. Number of getlines = number of lines. It will probably just add a single encompassing loop if you will use std::stringstream.
char *my_arr
yes i am using getline(my_arr,size,'\0');
Use getline(my_arr,size,'\n') in loop which will work until eof bit will be set.
i am using strtok in order to tokenize my text in words...my words are stored properly how do i use strtok such that it also stores \r\n in my words list..
Topic archived. No new replies allowed.