一个关于字符串的c语言程序

源程序:

#include <stdio.h>
#include <string.h>

int main()
{
char str[20];
int length;
length=strlen(strcpy(str,"Hello World!"));
printf("字符串长度:%d\n",length);
return 1;
}

运行结果:12

posted @ 2020-12-14 21:30  bobo哥  阅读(128)  评论(0编辑  收藏  举报