Any one know - How to find space between words in that file?
Bill Roberts said:
(Fri, Sep 16, 2011 02:30:55 AM)
It appears that i++ is over one line below the if statement, if it is, than it counts the characters in the file, else it counts the number of newline characters. Newline characters are not always indicative of a line, on windows \r\n is a line where on *nix it is \n.
(Fri, Jan 20, 2012 03:23:20 PM)
Any one explain the answer in detail.
(Fri, Mar 9, 2012 11:47:21 AM)
Some explanations are well, but some more are not to be understood, will you explain shortly.
(Mon, Jun 11, 2012 11:13:49 PM)
Firstly we are opening the file fp using fp = fopen("myfile.c", "r");
This also reads the file("r")
Now whatever the value equated to ch is counted
And we know that '\n' indicates every new lines arrival
By keeping track of \n in the statements
If(ch == '\n')
It results in number of new lines accessed