Skip to main content
Logo image

Section 20.5 String Length

C can find the length of a string for you! Of course, you could do so yourself. This means that strings are fundamentally different from general arrays, in that their length can be determined due to the placement of the null character at the end of each string.

admin.....open in new window

Investigate 20.5.

Without using strlen(), how could you find the length of a string?
Hint.
Remember, all strings are terminated by the null character /0.