Understanding memcpy
问题 int a = 10; int* pA = &a; long long b = 200; long long* pB = &b; memcpy (pB,pA,4); memcpy (pB+1,pA,4); cout<<"I'm a memcpy!: "<<*(pB)<<endl; I'm doing some tests with memcpy to teach myself how memory works. What I am trying to do is make b = to "1010". I can copy the value from a to b, but then I try to offset the memory by 1 byte and write another 10 but it doesn't work it only outputs "10". What would I need to do to get a value of 1010? 回答1: A few problems with your code as it stands: You