//字符串复制函数1
void strcpy1(char str1[], char str2[]){
int i = 0;}
//2
void strcpy2(char str1[], char str2[]){}
//字符串长度函数1
int strlen1(char str[]){
int i = 0;
while (str[i] != ‘\0‘)i++;
return i;
}
//2
int strlen2(char *str){
char *t = str;
while (*str != ‘\0‘){
str++;
}
return str - t;
}
//字符串比较函数1
int strcmp1(char str1[], char str2[]){
int i = 0;
for (; str1[i] != ‘\0‘; i++){
if (str1[i] != str2[i])break;
}
return str1[i] - str2[i];
}
//2
int strcmp2(char *str1, char *str2){
for (; *str1 != ‘\0‘; str1++, str2++){
if (*str1 != *str2)break;
}
return *str1 - *str2;
}
各种字符串函数(strcpy,strcmp,strlen)之深度剖析,布布扣,bubuko.com
各种字符串函数(strcpy,strcmp,strlen)之深度剖析
原文:http://blog.csdn.net/eh_sky/article/details/26011007