int my_strlen(const char *str) { const char *p; if (!str) return 0; for (p = str; *p; ++p) ; return p - str; }