Link to home
Start Free TrialLog in
Avatar of Carl3003
Carl3003

asked on

calculationg lines by \n and not word wrap?

I am just wondering if there is an easier way to calculate lines based on (enter key) \n. One one to do is to go trhough each char and find how many \n are there in the file. The statement i am using is:
while ( fgets( line, LINELEN, fp ) )
{ /* more input */
              total_lines++; /* count it */  
}

thanks
SOLUTION
Avatar of grg99
grg99

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial