strlen implementation from scratch

tux4life 0 Tallied Votes 241 Views Share

This is how mine strlen function would look like if I'd to implement it from scratch :)

/**
@author: Mathias Van Malderen (tux4life)
*/
size_t strlen(const char *s)
{
    size_t sz = 0;
    while(*s++) sz++;
    return sz;
}