home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BURKS 2
/
BURKS_AUG97.ISO
/
BURKS
/
SOFTWARE
/
LIBS
/
BPLUS11.ZIP
/
MEMMOVE.C
(
.txt
)
< prev
Wrap
C/C++ Source or Header
|
1988-12-08
|
771b
|
32 lines
/*****************************************************************
| memmove - move in memory with attention to order and overlap
|----------------------------------------------------------------
| Arguments:
| 1) destination: char *
| 2) source: char *
| 3) length: int
| Returns: none
****************************************************************/
void memmove (to, from, length)
char *to, *from;
int length;
{
register char *TO, *FROM;
if (to < from) {
/* move left to right */
TO = to;
FROM = from;
while (length--)
*(TO++) = *(FROM++);
}
else {
/* move right to left */
TO = to + length - 1;
FROM = from + length - 1;
while (length--)
*(TO--) = *(FROM--);
}
}