Jump to content

Talk:Longest string challenge: Difference between revisions

Line 321:
return 0;
}</lang> I haven't carefully checked all the comparisons in the above, but it's on the right track at least. --[[User:Ledrug|Ledrug]] 00:17, 17 August 2011 (UTC)
:::: Ok, I see what you are saying. I have updated the C implementation to avoid buffer overflow problems. Note that this will not prevent crashes nor erroneous results -- it's only correct if the lines are short enough and if few enough of them are long. --[[User:Rdm|Rdm]] 01:13, 17 August 2011 (UTC)
::In other words, this program will not block for input: <lang c>#include <stdio.h>
main() {
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.