I have this program, which is supposed to read a set of text lines and print the longest. However I can`t get it to print anything. Any suggestions, or is the program just dumb?
Hey pacman169, two problems:
1. Your identation sucks.
2. You don't know how to terminate your input. (<C-d> for *nix, you may also use stream redirection)
" Also, ¿why do you add the delimiter character to the line? "
I don`t understand the question. I think the program is supposed to count the lengths of the strings including whitespace, and when newline is hit, restart counting.
The next step is to count the lengths of arbitrarily long input lines, and output as number.
The loop in line 22 would end in the case of eof, no need to check again.
There is no point in using a while loop in you are not going to do any looping.
¿Is the line break character part of the line? like "hello" is actually "hello\n"