在前加#include
    strlen为C语言库函数,包含于string.h中,作用为计算一个字符串(字符数组)中元素的个数,即从数组头部计数,直到遇到字符串结束符\0为止,计数结果不包括\0.
    其声明为:
    unsigned int strlen(char s);
    比如定义字符串:
    char
    p = “this is for testing”;
    调用
    strlen(p);