源程序:
#include <stdio.h>
#include <string.h>
int main()
{
char str[20];
int length;
length=strlen(strcpy(str,"Hello World!"));
printf("字符串长度:%d
",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
",length);
return 1;
}
运行结果:12