Comment Re:Yes, let's do just that... (Score 1) 208
Well here one reason: strlen() relies on the input data being zero terminated.
The code: char foo[20] = "test string" would not have provided that, so the result would have been unknown (probably a large int) and the loop would have performed unexpectedly.
The code: char foo[20] = "test string" would not have provided that, so the result would have been unknown (probably a large int) and the loop would have performed unexpectedly.