模拟实现strcpy(C语言)
2017-09-07 22:07
351 查看
#include<stdio.h> #include<stdlib.h> #include<Windows.h> #include<string.h> #include<assert.h> char* my_strcpy(char* dest,const char* src) { char *ret = dest; assert(src != NULL); assert(dest != NULL); while(*dest++ = *src++) { ; } return ret; } int main() { char arr[80]={0}; printf("string=%s\n",my_strcpy(arr,"hello world")); system("pause"); return 0; }
相关文章推荐
- C语言:模拟实现strcpy
- 用c语言.模拟实现strcpy,strcat,strcat,memcpy,memmove
- 【面试题】C语言:模拟实现strncpy,尝试比较strncpy与strcpy区别。
- C语言-模拟实现strcpy
- C语言 模拟实现strcpy 与 strlen
- C语言,模拟实现strcpy、strlen函数
- [C语言]模拟实现strcpy/strncpy/strcat/strncat/strcmp/strncmp/strstr
- C语言中模拟实现strcpy,strstr,strcat函数
- c语言模拟实现strcpy
- C语言:字符串函数(strcpy,memcpy等)模拟实现
- C语言:模拟实现strlen、strcpy、strcmp、strReverse、strcat函数
- 【面试题】C语言:模拟实现strncpy,尝试比较strncpy与strcpy区别。
- 用c语言.模拟实现strcpy,strcat,strcat,memcpy,memmove
- C语言字符串函数的模拟实现(strlen、strcpy、strcat、strstr 、strcmp)
- C语言中模拟实现strcpy,strstr,strcat函数
- C语言:模拟实现strcpy
- C语言模拟实现strcpy、strlen、strcmp、strcat
- 【C语言】模拟实现strcpy、strcat、strcmp函数
- C语言模拟实现strcpy、strncpy、strcmp、strcat、strstr
- 【C语言】【笔试题】模拟实现strstr函数