C语言编程,输出指定字符串的长度

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C语言编程,输出指定字符串的长度相关的知识,希望对你有一定的参考价值。

#include "string"
char szbuffer[] = "abc";
int size = strlen(szbuffer);
printf("字符串的长度=%d",size);
参考技术A int l;
int str1[128];

strcpy(str1,"hello");

l=strlen(str1);
printf("l=%d",l);

以上是关于C语言编程,输出指定字符串的长度的主要内容,如果未能解决你的问题,请参考以下文章