内存重叠

内存重叠要考虑拷贝数据的方向。 往前移,先移动前面的数据; 往后移,先移动后面的数据。 eg: #include <stdio.h> #include <stdlib.h> #include <string.h> //n表示数组长度 //m表示需要移到的后半段的数据长度 (把数组中后m个数据放到数组最前面) void Move(int *arr,int n,int m) { if(arr==NUL
相关文章
相关标签/搜索