C语言-模拟实现strcpy
2017-11-16 18:21
239 查看
模拟实现strcpy
代码实现(环境:Visual Studio 2017)
代码实现(环境:Visual Studio 2017)
//模拟实现strcpy #include<stdio.h> #include<windows.h> void Mystrcpy(char *str1, char *str2) { int i = 0; int j = 0; while (str1[i++] = str2[j++]); } int main() { char str1[] = { "ABCDE" }; char str2[] = { "abc" }; printf("调用前str1 : %s\n", str1); Mystrcpy(str1, str2); printf("调用后str1 : %s\n", str1); system("pause"); return 0; }
相关文章推荐
- 用c语言.模拟实现strcpy,strcat,strcat,memcpy,memmove
- 【面试题】C语言:模拟实现strncpy,尝试比较strncpy与strcpy区别。
- c语言模拟实现strcpy
- C语言:模拟实现strlen、strcpy、strcmp、strReverse、strcat函数
- [C语言]模拟实现strcpy/strncpy/strcat/strncat/strcmp/strncmp/strstr
- C语言模拟实现strcpy、strncpy、strcmp、strcat、strstr
- C语言中模拟实现strcpy,strstr,strcat函数
- C语言:模拟实现strcpy
- C语言中模拟实现strcpy,strstr,strcat函数
- C语言:字符串函数(strcpy,memcpy等)模拟实现
- C语言 模拟实现strcpy 与 strlen
- C语言,模拟实现strcpy、strlen函数
- C语言字符串函数的模拟实现(strlen、strcpy、strcat、strstr 、strcmp)
- 模拟实现strcpy(C语言)
- C语言模拟实现strcpy、strlen、strcmp、strcat
- 用c语言.模拟实现strcpy,strcat,strcat,memcpy,memmove
- 【面试题】C语言:模拟实现strncpy,尝试比较strncpy与strcpy区别。
- C语言:模拟实现strcpy
- 【C语言】模拟实现strcpy、strcat、strcmp函数
- 模拟实现c语言中的动态内存分配malloc函数