标签:自定义实现复制函数
自定义实现复制函数
<span style="font-size:18px;">/strcpy函数 void strCpy1(char dest[], char source[]) { int i = 0; while (source[i] != ‘\0‘) { dest[i] = source[i]; i++; } dest[i] = ‘\0‘; } void strCpy2(char *dest, char *source) { while ((*dest++ = *source++) != ‘\0‘) { } } //strlen函数 unsigned long strLen(char str[]) { unsigned long length = 0; int i = 0; while (str[i] != ‘\0‘) { length++; i++; } return length; } </span>
标签:自定义实现复制函数
原文地址:http://9217856.blog.51cto.com/9207856/1563751