Moves a specified number of bytes from a source buffer to a destination buffer.
#include <string.h> void *memmove (void *dest, const void *src, size_t count);
errno_t memmove_s(void *dest, rsize_t destmax, const void *src, rsize_t count);
#include <wchar.h>
wchar_t *wmemmove(wchar_t *dest, const wchar_t *src, size_t num);
errno_t wmemmove_s(wchar_t *dest, rsize_t destmax, const wchar_t *src, rsize_t count);
dest
src
destmax
count
If some regions of src
area and dest
overlap, these functions ensure that characters in the overlapping region are copied before being overwritten.
The memmove_s function copies count characters from the object pointed to by src into the object pointed to by dest. This copying takes place as if the count characters from the object pointed to by src are first copied into a temporary array of count characters that does not overlap the objects pointed to by dest or src, and then the count characters from the temporary array are copied into the object pointed to by dest. This function is subject to contraints:
If there is a runtime-constraint violation, the memmove_s function stores zeros in the first destmax characters of the object pointed to by dest if dest is not a null pointer and destmax is not greater than RSIZE_MAX.
memmove returns pointer to the destination buffer dest.
memmove_s returns 0 on successful completion, else a non-zero value.
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 INtime 4.2 (memmove_s) INtime 6.0 (for wide-characeter versions) |
intime/rt/include/string.h intime/rt/include/wchar.h |
string.h wchar.h |
clib.lib |