源程序:
#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
源程序:
#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
上一篇:一个简单的c程序,规范的函数写法
下一篇:自考新教材--p31
【C语言加油站】字符函数与字符串函数详细介绍字符函数与字符串函数的相关知识点……
C语言如何输入一个字符串?
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M