赞
踩
实现strcpy函数char * strcpy ( char * destination, const char * source );
destination:目的地,指向的目标数组
source:来源,即需要复制的数组
strcpy用途如下:数组arr2[]复制到数组arr1[]
- #include <stdio.h>
-
- #include <string.h>
-
- int main()
-
- {
-
- char arr1[20] = "xxxxxxxxxxxxxxx";
-
- char arr2[] = "hello";
-
- strcpy(arr1, arr2);
-
- printf("%s\n",arr1);
-
- printf("%s\n", arr2);
-
- return 0;
-
- }
实现strcpy函数
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。