Hey,
I have these two pointers and I want to copy pointer1 data to pointer2. I tried to use memcpy and it did what I wanted but when I accessed pointer2 outside of the method that I did The memcpy in it didn't contain pointer1 data. Below is code similar to the code that I used:
The error ... pInitBlock1Saved is a variable. Somewhere in memory there is a block of memory (A) big enough to hold a pointer, i.e. a memory address. &pInitBlock1Saved is the location of that memory block.
The memory address that is stored in the memory refers to an another memory block (B) elsewhere.
memcpy(foo,&pInitBlock1Saved ... copy from location A ...
memcpy(foo,pInitBlock1Saved ... copy from location B ...
foo = *pInitBlock1Saved; ... copy from location B ...