#define _CRT_SECURE_NO_WARNINGS 1 #include<stdio.h> #include<string.h> #include<assert.h> //内存操作函数 //memcpy-内存拷贝 int main() { int arr1[10] = { 1,2,3,4,5,6,7,8,9,10 }; int arr2[10] = { 0 }; memcpy(arr2, arr1, 20); int* p = arr2; int i = 0; int sz = sizeof(arr2) / sizeof(arr2[0]); for (i = 0; i < sz; i++) { printf("%d ", *p++); } return 0; }
原创文章,作者:端木书台,如若转载,请注明出处:https://blog.ytso.com/244894.html