when doing that code:
void *ft_memcpy(void *dest, const void *src, size_t n)
{
void *orgdest;
orgdest = dest;
while (n > 0)
{
*(unsigned char *)dest = *(unsigned char *)src;
n--;
dest++;
src++;
}
return (orgdest);
}
the void pointer has been typecasted to unsigned char* to copy from src to dest. Then I use the pointers inside the while loop (dest++; src++;). Should I cast them again for the arithmetics (as they were void*, and cant be used for arithmetics) like dest = ((unsigned char *)dest + 1); or are they already casted to the unsigned char type and can be used?