The C library function size_t strlen(const char *str) computes the length of the string str up to, but not including the terminating null character.
size_t strlen(const char *str)
#include #include int main () { char str[50]; int len; strcpy(str, "This is tutorialspoint.com"); len = strlen(str); printf("Length of |%s| is |%d|\n", str, len); return(0); }
Length of |This is tutorialspoint.com| is |26|