Solving C++ 'target of assignment not really an lvalue' errors
- by Jason
Given this code:
void FrMemCopy(void *to, const void *from, size_t sz)
{
size_t sz8 = sz >> 3;
size_t sz1 = sz - (sz8 << 3);
while (sz8-- != 0) {
*((double *)to)++ = *((double *)from)++;
}
while (sz1-- != 0) {
*((char *)to)++ = *((char *)from)++;
}
}
I am receiving target of assignment not really an lvalue warnings on the 2 lines inside the while loops.
Can anyone break down those lines?
a cast then an increment?
What is a simplier way to write that?
What does the error mean?