Re: Implementing my own memcpy



On Sun, 26 Jun 2005 01:07:00 +1000, Netocrat <netocrat@xxxxxxxxxxx>
wrote:

>On Sat, 25 Jun 2005 07:28:30 -0700, Rajan wrote:

(...)

>#include <stddef.h>
>
>void *mem_cpy(void *dest, const void *src, size_t bytes)
>{
> unsigned char *srcmax = dest + bytes;
>
> while (src < srcmax)

I don't understand this line. You are comparing one array src to
another srcmax. Perhaps I missed something, but I do not believe that
they are looking into the same array. Did you mean to define srcmax
differently?

unsigned char* srcmax = src + bytes;

--

Best wishes,

Bob
.