#include<stdio.h>
#include<string.h>
int main()
{
int s(char *c, int x);
int a=0;
char b[100];
gets(b);
char *p = b;
int t;
t = s(p,a);
printf("字符串的长度为%d", t);
return 0;
}
int s(char *c,int x)
{
int z;
z = strlen(c);
return (z);
}
---------------------------------------------------------
#include<stdio.h>
#include<string.h>
int main()
{
int s(char *c);
int a = 0;
char b[100];
gets(b);
char *p = b;
a = s(p);
printf("字符串的长度为%d", a);
return 0;
}
int s(char *c)
{
int z = 0;
z = strlen(c);
return (z);
}
[此贴子已经被作者于2016-12-3 21:49编辑过]