void mycopy(int* dst, int* src, int* src_end)
{
if(dst==src) return;
int n = src_end - src;
if(dst>src)
for(int i=n-1; i>=0; i--) dst[i] = src[i];
else
for(int i=0; i<n; i++) dst[i] = src[i];
}
void show(int* a, const int n)
{
for(int i=0; i<n; i++) cout << a[i] << " ";
cout << endl;
}
int main()
{
int a[] = {1,2,3,4,5};
int b[] = {4,5,6,7,8};
mycopy(a+3,b,a+4);
show(b,5);
return 0;
}
这当中的int n ;n代表什么意思