Line by line reading in C and C++?

I want to read line by line from a file in C or C++, and I know how to do that when I assume some fixed size of a line, but is there a simple way to somehow calculate or get the exact size needed for a line or all lines in file? (Reading word by word until newline is also good for me if anyone can do it that way.)

5
задан Jonathan Leffler 8 April 2011 в 15:50
поделиться