My task is to exploit a program which has two lines of code of memcpy. So I'm now studying memcpy and just found this.
int main() {
char a[10] = "123456789";
cout<<a<<endl;
char b[5];
memcpy(b, a, 10);
cout<<a<<endl;
cout<<a-5<<endl;
cout<<b<<endl;
}
and the output will be:
123456789
6789
123456789
123456789
Any idea Why the pointer of a changed here?