Why does visual studio refuse to execute this function? I thought this was how memory blocks were copied?
Additional notes: I'm working on the gba and I have to copy a memoryblock in bytes in order to write to the memory slot(game saves)
void * memcpy(void * dst, void const * src, size_t len)
{
char * pDst = (char *) dst;
char const * pSrc = (char const *) src;
while (len--)
{
///////////////////////////////////////////////
//error section here
*pDst++ = *pSrc++;
///////////////////////////////////////////
}
return (dst);
}
It's C++, not C (determined by the use of
std). Use the new casting operators.
|
char *pDst(static_cast<char *>(dst));
|
Wazzak
Last edited on