用strlen函数计算字符串的长度(C语言)

来源:互联网 发布:sql select 结果 左链 编辑:程序博客网 时间:2024/05/15 01:30
#include<stdio.h>
#include <string.h>
int main()
{  

    int   changdu;

    char a[20]  = "hello\n";
    changdu =  strlen (a);  //计算字符串a的长度
    printf("the size of a is %d",changdu);
    return 0;
}

0 0