#include <iostream>
#include <vector>
#include <algorithm>
#include<iterator>
#include <cstring>
using namespace std;
int main(){
int *a=new int[10];
for(int i=0;i<10;i++)
{
a[i]=i;
}
memmove(a+6,a+7,3*sizeof(int));
for(int i=0;i<10;i++){
cout<<a[i]<<endl;
}
return 0;
}
结果:
转载
:
https://blog.csdn.net/weixin_36125166/article/details/74853548?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522163412710016780271592852%2522%252C%2522scm%2522%253A%252220140713.130102334…%2522%257D&request_id=163412710016780271592852&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allsobaiduend~default-1-74853548.pc_search_all_es&utm_term=memmove%E5%87%BD%E6%95%B0