How to calculate the length of a string in C efficiently? - Stack Overflow How to calculate the length of a string in C efficiently (in time)? Right now I'm ... From the FreeBSD source code: size_t strlen(const char *str) { const char *s; for (s ...