#include <stdio.h> #include <stdlib.h> #include <assert.h> char *my_strcpy(char *dest, const char *src) { assert(dest); assert(src); char *ret = dest; while (*dest++ = *src++) { ; } return ret; } int main() { char arr1[] = "welcome to bit!"; char arr2[20]; char *ret = my_strcpy(arr2, arr1); printf("%s", ret); system("pause"); return 0; }
【C语言】【面试题】【笔试题】模拟实现数据库中strcpy函数
原文地址:http://10740329.blog.51cto.com/10730329/1714520