1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#include <stdio.h>

int my_strlen(char* s) {
    int length = 0;
    while(s[length] != '\0') {
        length += 1;
    }
    return length;
}

int main(int argc, const char *argv[])
{
    printf("my_strlen(\"Hi\") == %d\n", my_strlen("Hi"));   
    return 0;
}

This content is protected and may not be shared, uploaded, or distributed.    © 2019 Alexander J. Quinn.