A C string is a char array that ends with a hidden '\0' byte. Functions like strlen stop at that terminator.
In C a string is not a special object. It is a row of characters that ends with a hidden 0 byte called the null terminator. Functions like strlen walk until they find that 0.
[0]
[1]
[2..4]
stop
Each step highlights the matching C line. Program output appears only when a line that prints actually runs.
Five questions. Pick one answer each, then Check answers. The correct choice turns green.
1. "Kodin" needs at least how many chars of storage?
Terminator.
2. strlen counts:
Stops at 0.
3. A C string is:
Convention + array.
4. string.h is included for:
String helpers.
5. Missing \0 and then strlen is:
Read until a random 0.