I have been trying out you code and modified it some and more questions have popped into my head. Bear with me. I want to have a clear understanding of what is going on. Here goes.
>Never modify your caller's pointers. Always work with a copy.
Arent we here modifying the callers pointers anyway, since the changes made to d and s affect dPtr and sPtr which are the orignal pointers
i could only get this to work
d = dPtr; /* copy original pointers */
s = sPtr;
like this. Am i moving the address of the pointer one bit up here or actually dereferencing the pointer an asigning data or doing both?
d++ = s++;
*d++ = *s++;
> You're working with raw memory, so use 'unsigned' instead.
Why are unsigned variables better.
>Use unsigned long (in the cast) instead
Is this because a long is the maximum c variable?
However, the function does work, except for i really need to insert a null terminator at the end if a pass char arrays. Is it safe to do so on any type passed to this function.