正在加载图片...
615编写一个函数,能测出一个字符串的长度,函 数返回值是字符串的长度。 #inc|Ude“ stdio.h” main() f int len(char*ps), l; char string[80], *p gets(string); p=string; len(p) puts(p) printf((%d”,); int len(char *ps) int n=0 while(*ps!=“0) n++; ps++,1 return(n)6.15 编写一个函数,能测出一个字符串的长度,函 数返回值是字符串的长度。 #include “stdio.h” main( ) { int len(char *ps),l; char striing[80] , *p ; gets(string); p=string; l=len(p); puts(p); printf(“%d”,l ); } int len(char *ps) { int n=0; while (*ps!=‘\0’) { n++; ps++; } return(n) }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有