M
Michael C
I've got a pointer to a byte and want to set the byte it points to to zero
as well as the three bytes after. I could do this
dstPtr[0] = 0;
dstPtr[1] = 0;
dstPtr[2] = 0;
dstPtr[3] = 0;
but can convert it to an int* first and just do
*(int*)dstPtr = 0;
is this correct and is it good practice? Is it the best way to do it?
Thanks,
Michael
as well as the three bytes after. I could do this
dstPtr[0] = 0;
dstPtr[1] = 0;
dstPtr[2] = 0;
dstPtr[3] = 0;
but can convert it to an int* first and just do
*(int*)dstPtr = 0;
is this correct and is it good practice? Is it the best way to do it?
Thanks,
Michael