A C string has a hidden '\0' at the end that means "stop here". Without strlen, write your own my_strlen(s): count from the start, stop at '\0', and return the count. "hello" is 5, a space counts as a character, and the empty string "" is 0.
my_strlen("hello")→5my_strlen("")→0my_strlen("a b c")→5int my_strlen(const char *s)int my_strlen(const char *s) {
int n = 0;
// your code here: until you reach '\0', add 1 to n
return n;
}
Run tries the examples. When they look right, Submit.