📄 memmove.c
字号:
/*FUNCTION <<memmove>>---move possibly overlapping memoryINDEX memmoveANSI_SYNOPSIS #include <string.h> void *memmove(void *<[dst]>, const void *<[src]>, size_t <[length]>);TRAD_SYNOPSIS #include <string.h> void *memmove(<[dst]>, <[src]>, <[length]>) void *<[dst]>; void *<[src]>; size_t <[length]>;DESCRIPTION This function moves <[length]> characters from the block of memory starting at <<*<[src]>>> to the memory starting at <<*<[dst]>>>. <<memmove>> reproduces the characters correctly at <<*<[dst]>>> even if the two areas overlap.RETURNS The function returns <[dst]> as passed.PORTABILITY<<memmove>> is ANSI C.<<memmove>> requires no supporting OS subroutines.QUICKREF memmove ansi pure*/#include <string.h>/*SUPPRESS 20*/_PTR_DEFUN (memmove, (dst_void, src_void, length), _PTR dst_void _AND _CONST _PTR src_void _AND size_t length){ char *dst = dst_void; _CONST char *src = src_void; if (src < dst && dst < src + length) { /* Have to copy backwards */ src += length; dst += length; while (length--) { *--dst = *--src; } } else { while (length--) { *dst++ = *src++; } } return dst_void;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -