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.
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.
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..