M
Mike Wahler
Mac said:$ cat junk27.c
#include <stdio.h>
#include <string.h>
You don't need this header.
int main (void)
{
printf("The difference between memcpy and memmove is %ld\n",
(long int) memcpy - (long int) memmove);
Note: This is not portable. But if I wanted to do this,
I'd use 'unsigned long' or 'unsigned long long'.
6.3.2.3 Pointers
6 Any pointer type may be converted to an integer type.
Except as previously specified, the result is implementation-
defined. If the result cannot be represented in the integer type,
the behavior is undefined. The result need not be in the range
of values of any integer type.
AFAICT, 'previously specified' only refers to:
6.3.2.3
3 An integer constant expression with the value 0, or such
an expression cast to type void *, is called a null pointer
constant. If a null pointer constant is converted to a
pointer type, the resulting pointer, called a null pointer,
is guaranteed to compare unequal to a pointer to any object
or function.
return 0;
}
-Mike