2009-11-26, 07:41 PM
JoeTang Wrote:I highly suggest youStrings are null-terminated, so the end of the string breaks the loop.reviewlearn how to do loops. Breaking conditions are there for a reason; that reason is not to stick a random letter there.
It's a lazy way to do things, but it works so why not.
True, the nicer way to do it would be
Code:
for (i = 0; i < strlen(longstr); i++)Code:
for (i = 0; longstr[i][color=gray] != '\0'[/color]; i++)
