strlen c code code example Example: c strlen int my_strlen(char *str) { int i = -1; while (str && str[++i]); return (i); }