I'm trying to copy a continuous block of data from one location in the Main Memory to another location. Here's what I did so far, but it's not working. It seems that after applying 'memcpy', the content of my array 'testDump' becomes all zeros.
//Initialize array to store pixel values of a 640x480 image
int testDump[204800];
for(int k = 0; k<204800; k++)
testDump[k] = -9;
//pImage is a pointer to the first pixel of an image
pImage = dmd.Data();
//pTestDump is a pointer to the first element in the array
int* pTestDump = testDump;
//copy content from pImage to pTestDump
memcpy (pTestDump, pImage, 204800);
for(int px_1 = 0; px_1<300; px_1++)
{
std::cout<<"Add of pPixel: "<<pImage+px_1<<", content: "<<*(pImage+px_1);
std::cout<<"Add of testDump: "<<pTestDump+px_1<<", content: "<<*(pTestDump+px_1);
}
Advice and suggestions are appreciated.
Thanks
Roronoa Zoro