摘要: 指针做参数传递写出下面的函数,实现计算字符串长,字符串复制功能int strlen(char *s)void strcpy( char *s, char *t)1 int strlen(char *s)2 {3 char *ss;4 ss=s;5 while(*ss!='\0') ss++;6 return ss-s;7 }1 void strcpy( char *s, char *t)2 {3 while((*s=*t)!='\0')4 {5 s++;6 t++;7 }8 } 阅读全文
posted @ 2012-02-10 12:40 pony1993 阅读(625) 评论(1) 推荐(1) 编辑

View My Stats